#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int a=1;
  for(int i=0; i<n; i++){
    int b;
    cin >> b;
    a *= b;
    if(a > 1000000000000000000){
      cout << -1 << endl;
      break;
    }
    else if(i==n-1){
      cout << a << endl;
    }
  }
}