import "dart:io";
import 'dart:async';
import 'dart:convert';
import 'dart:math' as Math;

void main() async {
  int N = int.parse(stdin.readLineSync());
  var lines = stdin.transform(utf8.decoder).transform(LineSplitter());
  List<int> A = [];
  await for (var line in lines) {
    A = line.split(' ').map((x) => int.parse(x)).toList();
  }
  for (int i = 0; i < N; i++) {
    if (A[i] == 0) {
      print(0);
      return;
    }
  }
  final M = Math.pow(10, 18) as int;
  int r = 1;
  for (int i = 0; i < N; i++) {
    if (r * A[i] <= M) {
      r *= A[i];
    } else {
      print(-1);
      return;
    }
  }
  print(r);
}
