import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(in.readLine()); n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in long[] a = new long[n]; a new long[n] n long sum = 1; sum 1 long lastSum = 1; lastSum 1 boolean over = false; over false String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    } {
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    } a[i] = Long.parseLong(str[i]) a[i] a i Long.parseLong(str[i]) Long.parseLong Long str[i] str i if(a[i]==0) {
        System.out.println(0);
        return;
      } a[i]==0 a[i] a i 0 {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; sum *= a[i] sum a[i] a i if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      } lastSum > sum || sum > 1000000000000000000L lastSum > sum lastSum sum sum > 1000000000000000000L sum 1000000000000000000L {
        over = true;
      } over = true over true lastSum = sum lastSum sum System.out.println(over?-1:sum) System.out.println System.out System System.out over?-1:sum over -1 1 sum String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    long[] a = new long[n];
    long sum = 1;
    long lastSum = 1;
    boolean over = false;
    String[] str = in.readLine().split(" ");
    for(int i = 0; i < n; i++){
      a[i] = Long.parseLong(str[i]);
      if(a[i]==0) {
        System.out.println(0);
        return;
      }
      sum *= a[i];
      if(lastSum > sum || sum > 1000000000000000000L) {
        over = true;
      }
      lastSum = sum;
    }
    System.out.println(over?-1:sum);
  }
}