mod = 10 ** 9 + 7
N,M = map(int,input().split())
X = [1,1]
for i in range(N):
    X.append((X[i]+X[i+1]) % mod)
#print(X)
a = int(input())
ans = X[a - 1]
#print(ans)
tmp = a
check = 0
for _ in range(M-1):
    a = int(input())
    if a - tmp == 1:
        check = 1
    y = a - tmp - 2
    ans *= X[y]
    ans %= mod 
    tmp = a
    #print(ans)
y = N - tmp - 1
ans *= X[y]
ans %= mod 
if check == 1:
    print(0)
else:
    print(ans)