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

  final ans = list.reduce((value, element) => value * element);
  print(ans > max ? -1 : ans);
}
