n,m = map(int, input().split())
mod = 10**9+7

lst = []
for i in range(m):
    lst.append(int(input()))
lst.sort()

#2連続穴がある場合
for i in range(len(lst)-1):
    if lst[i]+1 == lst[i+1]:
        print(0)
        exit()

lst2 = []
for i in range(len(lst)):
    if i==0:
        lst2.append(lst[0]-1)
    else:
        lst2.append(lst[i]-lst[i-1]-2)
lst2.append(n-lst[-1]-1)



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

ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod

print(ans)
