import java.util.*;
import java.lang.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  } main {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan long limit = (long) Math.pow(10,18); limit (long) Math.pow(10,18) Math.pow Math 10 18 long sum = 1; sum 1 long [] c = new long[a]; c new long[a] a for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    } int i=0; int i=0; i 0 i<a i a i++ i++ i {
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    } {
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    } long b = scan.nextLong(); b scan.nextLong() scan.nextLong scan if (b==0){
        System.out.println(0);
        return;
      } b==0 b 0 {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; c[i] = b c[i] c i b for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    } int j=0; int j=0; j 0 j<a j a j++ j++ j {
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    } {
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    } if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      } Math.log10(sum)+Math.log10(c[j])>18 Math.log10(sum)+Math.log10(c[j]) Math.log10(sum) Math.log10 Math sum Math.log10(c[j]) Math.log10 Math c[j] c j 18 {
        System.out.println(-1);
        return;
      } System.out.println(-1) System.out.println System.out System System.out -1 1 return; sum*=c[j] sum c[j] c j if (sum>limit){
      System.out.println(-1);
      return;
    } sum>limit sum limit {
      System.out.println(-1);
      return;
    } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  }
} Main
import java.util.*;
import java.lang.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();

    long limit = (long) Math.pow(10,18);
    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }

    if (sum>limit){
      System.out.println(-1);
      return;
    }
    System.out.println(sum);
  }
}
