n, k = input().split(' ')
n, k = int(n), int(k)
s = input().split(' ')
s.sort()
for i in range(len(s)):
    s[i] = int(s[i])

d = {}
m = []

for i in range(1, n+1):
    d[i] = 0

for i in range(1, n+1):
    if i in s and d[i] == 0:
        c = 1
        m.append(i)
        while i * c <= n:
            if d[i*c] == 0:
                d[i*c] = 1
            else:
                d[i*c] = 0
            c += 1
    else:
        if i not in s and d[i] == 1:
            c = 1
            m.append(i)
            while i * c <= n:
                if d[i*c] == 0:
                    d[i*c] = 1
                else:
                    d[i*c] = 0
                c += 1
                
        
for i in range(len(m)):
    m[i] = str(m[i])

print(len(m))
print(" ".join(m))