n, m = map(int, input().split())
broken = []
for i in range(m):
    broken.append(int(input()))
    if len(broken) > 1 and broken[-2] + 1 == broken[-1]:
        print(0)
        exit()
    

dp = [0] * (n + 1)
def rec(i):
    global dp
    if dp[i] > 0:
        return dp[i]
    
    if i >= n - 1:
        return 1
    
    if i in broken:
        return 0
    
    dp[i] = rec(i + 1) + rec(i + 2)
    
    return dp[i]
            
print(rec(0)%1000000007)