#include<stdio.h>

int main(){
  int N;
  scanf("%d", &N);
  long int A, ans = 1;
  for(long int i = 0; i < N; i++){
    scanf("%ld", &A);
    ans *= A;
  }
  if(ans > 1000000000000000000) ans = -1;
  printf("%ld", ans);
  return 0;
}