n,m = map(int,input().split())
stair = [0,1] + [0 for i in range(n)]
ba = 2
for i in range(m):
	a = int(input()) + 1
	for j in range(ba,a):
		stair[j] = stair[j - 1] + stair[j - 2]
	ba = a + 1
for i in range(ba,n + 2):
	stair[i] = stair[i - 1] + stair[i - 2]
print(stair[n + 1])
print(stair)