import math n=int(input()) a=list(map(int,input().split())) if 0 in a: print(-1) exit()