import 'dart:io';
import 'dart:math' as Math;

main(List<String> args) {
  final max = Math.pow(10, 18) as int;

  final cnt = int.parse(stdin.readLineSync());
  final listTemp = stdin.readLineSync();

  bool zero = false;
  final list = listTemp.split(" ").map((e) {
    int n = int.parse(e);
    if (n == 0) {
      zero = true;
    }
    return n;
  }).toList();

  if (zero) {
    print(0);
    return;
  }
  if (cnt >= 60) {
    print(-1);
    return;
  }

  var ans = list.removeAt(0);
  for (int n in list) {
    if ((ans *= n) > max) {
      print(-1);
      return;
    }
  }
  print(ans);
}
