#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    a = (arr[i] > max) ? 1 : a;
    c *= arr[i];
    (arr[i]) ? max /= arr[i] : b = 1;
  }

  (b) ? puts("0") : ((a) ? puts("-1") : printf("%lld\n", c));
  return 0;
}