import sys
input = sys.stdin.readline
 
N,M = list(map(int,input().split()))
lis = [-1]*(N+1)
for i in range(M):
    lis[int(input())] = 0
lis[0] = 1
if lis[1]==-1:
    lis[1] = 1 
for i in range(2,N+1):
    if lis[i] == -1:
        
        lis[i] = lis[i-1] + lis[i-2]

        
    if lis[i] ==0 and lis[i-1] == 0:
        break
print(1 if N == 1 else lis[-1]%1000000007)

