#C
n, m = map(int, input().split())
a = [1] * (n + 1)
mod=1e9+7
print(a)
for i in range(m):
    a[int(input())] = 0
print(a)
b = [1] * (n + 1)
if a[1] == 0:
    b[1] = 0
for i in range(2, n + 1):
    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print(b, b[n])