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());
  if (cnt >= 60) {
    print(-1);
    return;
  }

  final list = stdin.readLineSync().split(" ").map((e) => int.parse(e)).toList()
    ..sort((a, b) => b.compareTo(a));
  var ans = list.removeAt(0);
  if ((ans) > max) {
    print(-1);
    return;
  }

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