#include <stdio.h>

int main(){
    int data[100];
    int N,num,i,n,sum,ove;
    char s[20];
    num = 0;
    sum = 1;

    for(i=0;i<=N;i++){
        scanf("%d", &data[i]);
    }

    while(num < N + 1){
        sum = sum * data[num];
        sum++;
    }

    sprintf(s,"%d",sum);

    for(n =0;s[n] != '\0' ; n++)

    if(sum <= 19){
        printf("%d",sum);
    }else{
        printf("%d",-1);
    }

}
