import sys
N, M = map(int,input().split())
x = [int(input()) for i in range(M)]
for i in range(len(x)-1):
    if x[i]+1 == x[i+1]:
        print(0)
        sys.exit()

a,b = 1,0
for i in range(1,N+1):
    if i - 2 in x:
        a,b = a, a
    elif i-1 in x:
        a,b = b,a
    else:
        a,b = a+b,a
    a %= 1000000007
    b %= 1000000007
print(a)
