import 'dart:io';
 
void main(List<String> args) {
  int N = int.parse(stdin.readLineSync());
  List<int> A = stdin.readLineSync().split(" ").map((i) => int.parse(i)).toList();
  A.sort();
  int ans = 1;
  for(int i=0; i<N; ++i){
    if(A[i] == 0){
      ans = 0;
      break;
    }
    else if(1000000000000000000 / ans >= A[i]) ans = ans * A[i];
    else{
      ans = -1;
      break;
    }
  }
  print(ans);
}