只要判断list里面有没有1即可 n = int(raw_input()) line = map(int,raw_input().split()) if 1 in line: print -1 else: print 1