n,m = map(int,input().split())
lis = [0]*(n+1)
a = []
for i in range(m):
    a.append(int(input()))

if n==1:
    print(1)
elif n==2:
    if m==1:
        print(1)
    else:
        print(2)
else:##n>=3
    if 1 in a and 2 in a:
        print(0)
    elif 1 in a:
        lis[2] = 1
    elif 2 in a:
        lis[1] = 1
    else:
        lis[1] = 1
        lis[2] = 2
    
    for j in range(3,n+1):
        if j in a:
            pass
        else:
            lis[j] = lis[j-1] + lis[j-2]
        
        if lis[j] == 0 and lis[j-1] == 0:
            break
    print(lis[n]%1000000007)