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 = [0,1]

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

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

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



