#include <stdio.h>
#define N 100000
int main()
{

    int a;
    unsigned long long z = 1;
    scanf("%d", &a);
    unsigned long long  s[N];
    unsigned long long n = 0;
    int count = 0;
    int flag = 0;
    for (int i = 0; i < a; i++)
    {
        scanf("%lld", &s[i]);
        if(s[i]==0){
            flag = 1;
            break;
        }
        if (s[i] > 1000000000000000000){
            flag = 2;
            
        }
        n = s[i];
        for (int j = 0; j < 18; j++)
        {
            break;
            n = s[i] / 10;
            if (n > 10)
                count++;
        }
    }



    if (flag == 1){
        printf("0");
    }
    else if (flag == 2 || count>=18){
        printf("-1");
    }
    else{
         for (int i = 0; i < a; i++)
        {
            if (1000000000000000000/s[i]<z){
                flag = 3;
                break;
            }
            if (s[i] * z > 1000000000000000000)
            {
                printf("-1");
                flag = 3;
                break;
                }
                else
                    z = s[i] * z;
        }
        if(flag==3)
            printf("-1");

        if(flag==0){
            printf("%lld", z);
        }
    }

  
    printf("\n");
}