n,m = (int(x) for x in input().split())
a = []
for i in range(m):
    a.append(int(input()))

total = [0 for _ in range(n)]
one = [0 for _ in range(n)]
two = [0 for _ in range(n)]

if 1 not in a:
    one[0] = 1
if 2 not in a:
    one[1] = 1
    two[1] = 1
total[1] = one[1]+two[1]

for i in range(2,n):
    if total[i-1] == 0 and total[i-2] == 0:
        print(0)
        exit()
    if (i+1) not in a:
        one[i] = total[i-1]
        two[i] = total[i-2]
        total[i] = one[i]+two[i]
print(a)
print(total[-1] % 1000000007)