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

int main() {
  int N;
  unsigned long long int ans = 1;
  cin >> N;
  
  unsigned long long int arr[N];
  for(int i { 0 }; i < N; ++i){
    cin >> arr[i];
    ans = ans * arr[i];
  }
  
  unsigned long long int cnst = 1;
  for (int i = 0; i < 18; i++) {
    cnst = cnst * 10;
  }
  
  if (ans > cnst) {
    cout << -1 << endl;
  }
  else {
    cout << ans << endl;
  }
}