N, M = map(int, input().split())
a = [0]*M
for i in range(M):
    a[i] = int(input())

now = 0
ans = 1
j = 0
for i in range(M):
    if now == a[i] - 1:
       now = a[i] + 1 
    elif now == a[i]:
        ans = 0
        break
    else:
        j = (a[i] - 1) - now
        k1 = 0
        k2 = 1
        k3 = 1
        for n in range(j):
            k3 = k2
            k2 += k1
            k1 = k3
        ans *= k2
        now = a[i] + 1

j = N - now
k1 = 0
k2 = 1
k3 = 1
for n in range(j):
    k3 = k2
    k2 += k1
    k1 = k3
ans *= k2
now = a[i] + 1
print(ans % 1000000007)