import "dart:io";
import 'dart:math' as Math;
void main(List<String> args) {
  var M = Math.pow(10, 18);
  int N = int.parse(stdin.readLineSync());
  List A = stdin.readLineSync().split(" ").map((x) => int.parse(x)).toList();
  int r = 1;
  A.forEach((x)=>r*=x);
  if (r>M) {
  	print(-1);
  } else {
  	print(r);
  }
}
