import sys
n, m = map(int, input().split())
a = []
ans = [0 for _ in range(n)]
for i in range(m):
    a.append(int(input()))
for i in range(m-1):
    if a[i+1]-a[i] == 1:
        print(0)
        sys.exit()
for i in range(n):
    if i+1 in a:
        ans[i] = 0
    else:
        if i == 0:
            ans[i] = 1
        elif i == 1:
            ans[i] = 1+ans[i-1]
        else:
            ans[i] = ans[i-1]+ans[i-2]
print(ans[-1]%(10**9+7))
