import copy
from collections import defaultdict

N = int(input())
A = list(map(int,input().split()))

def check_sc():
    scs = set([i for i in range(1,A[0]+1)])
    for a in A:
        now = copy.copy(scs)
        for sc in now:
            if a % sc != 0:
                scs.remove(sc)
    
    scs = list(scs)
    return (len(scs) == 1)
  
sc = check_sc()