#from itertools import accumulate

n, m = map(int, input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())
    # 2段続いている場合は最上段にたどり着けない
    if i>=2 and a[-2]+1 == a[-1]:
        print(0)
        exit()

l = [1] * (n+1)

for i in range(n+1):
    if i in a:
        l[i] = 0
    elif i > 2:
        l[i] = l[i-2] + l[i-1]

print(l[-1] % 1000000007)