N, M = map(int, input().split())

a = [0] * M
for i in range(M):
    a[i] = int(input())
    



def fib(n):
    memo = [0] * (int(n)+1)
    memo[0] = 1
    for i in range(1,n+1):
        if i in a:
          memo[i] = 0
        ## memo[i] i 番目の階段にいくまでのルート数
        else:
          memo[i] = memo[i-1] +memo[i-2]
    return memo[n]

print(fib(N) % 1000000007)
