n,m = map(int,input().split(' '))
l = []
for i in range(m):
    l.append(int(input()))
f = True
ans = 1
a = 0

def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    elif n == 2:
        return 2
    else:
        return fibonacci(n-1) + fibonacci(n-2)

for i in range(1,m):
    if l[i] - l[i-1] == 1:
        f = False
        print(0)
        break

if f:
    for i in range(m):
        if i == 0:
            ans *= fibonacci(l[i]-1)
        else:
            ans *= fibonacci(l[i]-l[i-1]-2)
    ans *= fibonacci(n-l[m-1]-1)
    print(ans%1000000007)