import sys
import numpy as np

N,M = map(int,input().split())
a_null = []
for _ in range(M):
    a_null.append(int(input()))

for i in range(len(a_null)-1):
    if a_null[i] + 1 == a_null[i+1]:
        print(0)
        sys.exit()
a = np.zeros(N+1)
for i in a_null:
    a[a_null] = 1

zero_index = np.where(a == 0)[0]
zero_renban = []
zero = 0
for i in range(len(zero_index)-1):
    if zero_index[i] + 1 == zero_index[i+1]:
        zero += 1
        if i +1 == len(zero_index)-1:
            zero_renban.append(zero)
    else:
        zero_renban.append(zero)
        zero = 0

zero_renban = np.array(zero_renban, dtype = 'int64')
zero_renban = np.delete(zero_renban, np.where(zero_renban == 0)[0])

memo = np.zeros(10**6)
def fib(n):
    if n <= 1:
        return n
    if memo[n] != 0:
        return memo[n]
    memo[n] = fib(n - 1) + fib(n - 2)
    return memo[n]

ans = 1
for i in zero_renban:
    ans *= fib(i)

print(int(ans%1000000007))