def fibo(n,memo={}):
    memo[0] = 0
    memo[1] = 1
    if n in memo:
        return memo[n]
    else:
        memo[n] = fibo(n-1,memo) + fibo(n-2,memo)
        return memo[n]

n,m = map(int,input().split())
s = []
for i in range(m):
    s.append(int(input()))

t = []
j = 1
for i in range(1,n+1):
    if i in s:
        t.append(j)
        j = 0
    else:
        j += 1
if j != 0:
    t.append(j)

ans = 1
for i in t:
    ans *= fibo(i)
ans %= 1000000007
print(ans)