#include<bits/stdc++.h>
 
using namespace std;
 
int main() {
  int n;
  unsigned long long a[100000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
  	scanf("%llu", &a[i]);
  }
  
  unsigned long long b = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] <= 1000000000000000000/b) {
    	b = b * a[i];	
    } else {
    	cout << -1 << endl;
     	return 0;
    }
  }
  
  cout << b << endl;
  
  return 0;
}