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

fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]

for i in range(m+1):
    if a[i+1] - a[i] < 2:
        if a[i+1] == 1 or a[i+1] == n: pass
        else :
            ans = 0
            break
    else :
        ans *= fib(a[i+1]-(a[i]+1))

print(ans % 1000000007)