import sys
N,M = map(int,input().split())
As = [int(input()) for e in range(M)]

if 1 in As and 2 in As:
    print(0)
    sys.exit()

if 1 in As and 2 not in As:
    patterns = [1,1]

if 1 not in As and 2 in As:
    patterns = [1,1]

if 1 not in As and 2 not in As:
    patterns = [1,2]

for i in range(3,N+1):
    value = 0
    if i-2 not in As:
        value += patterns[i-3]
    if i-1 not in As:
        value += patterns[i-2]
    patterns.append(value%1000000007)
print(patterns[-1]%1000000007)



