#include <stdio.h>

int main(){
  int n = 0;
  unsigned long long ans = 0;
  unsigned long long max = 1e18;
  scanf("%d", &n);
  int *arr = malloc(n*sizeof(int));
  
  for(int i = 0; i < n; i++){
    ans *= arr[i];
    if(ans > max){
      ans = -1;
      break;
    }
  }
  printf("%ulld", ans);
  return 0;
}