#include <stdio.h>
int main(void){
    int N;
    int i;
    scanf("%d", &N);
    int a;
    unsigned long long t = 1;
    for(i = 0;i < N;++i)
    {
        scanf("%d", &a);
        t *= a;
        if(a == 0)
        {
            printf("0\n");
            return 0;
        }
        if(t > 1000000000000000000)
        {
            printf("-1\n");
            break;
        }
    }
    return 0;
}