import "dart:io";
import 'dart:math' as Math;
void main() {
  int N = int.parse(stdin.readLineSync());
  List A = stdin.readLineSync().split(" ").map((x) => int.parse(x)).toList();
  if (A.indexOf(0)>-1) {
  	print(0);
  } else {
    final M = Math.pow(10, 18);
    int r = 1;
  	for (int i=0; i<A.length;i++) {
    	r*=A[i];
        if (r>M) {
        	print(-1);
            return;
        }
    }
    print(r);
  }
}
