dp = [0 for i in range(10000)]
dp[0] = 0
dp[1] = 1
for i in range(2,10000):
    dp[i] = dp[i-1]+dp[i-2]

#input    
n,m = map(int,input().split())
tmp1 = 0
tmp2 = 0

cnt = 1
flg = 0

for i in range(m):
    tmp2 = int(input())
    if tmp1 == tmp2:
        flg = 1
    cnt *= dp[tmp2-tmp1]
    tmp1 = tmp2+1
    
cnt *= dp[n-tmp2]
    
if flg == 0:
    print(cnt%1000000007)
else:
    print(0)



    
    
