#include<stdio.h>
int main() {
  int n;scanf("%d",&n);
  long long a[200000];
  for(int i=0;i<n;i++){
  	scanf("%d",&a[i]);
    if(!a[i]){printf("0\n");return 0;}
  }
  long long ans = a[0], tmp = a[0];
  for(int i=1;i<n;i++){
    ans*=a[i];
    if(ans < tmp){
      printf("-1\n");
      return 0;
    }
  }
  printf("%d\n",ans>(long long)1e18?-1:ans);
}