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();

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

  final list = listTemp.split(" ").map((e) => int.parse(e)).toList()
    ..sort((a, b) => b.compareTo(a));

  bool isOver = false;
  var ans = list.removeAt(0);
  for (int n in list) {
    if (isOver) {
      if (n == 0) {
        print(0);
        return;
      }
    } else {
      if ((ans *= n) > max) {
        isOver = true;
      }
    }
  }
  print(isOver ? -1 : ans);
}
