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

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

  stdin.readLineSync();
  final list =
      stdin.readLineSync().split(" ").map((e) => int.parse(e)).toList();
  var ans = list.removeAt(0);
  for (int n in list) {
    if ((ans *= n) > max) {
      print(-1);
      return;
    }
  }
  print(ans);
}
