N, H = gets.split.map &:to_i A = gets.split.map &:to_i A.each{H /= H.gcd(_1)} puts H == 1 ? "YES" : "NO"