import functools
import operator

def fib(n):
    a, b = 1, 2
    for i in range(n):
        yield a
        a, b = b, a + b

N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
if A[0] == 1:
    A.pop(0)
    A.insert(0, 1)
    A.append(N+1)
    sabun = [A[i+1]-A[i]-1 for i in range(M)]
else:
    A.insert(0, -1)
    A.append(N+1)
    sabun = [A[i+1]-A[i]-1 for i in range(M+1)]
# print(sabun)
if min(sabun) == 0:
    print("0")
else:
    f = [i for i in fib(max(sabun))]
    f.insert(0, 1)
    # print(f)
    ans = [f[i-1] for i in sabun]
    # print(ans)
    result = functools.reduce(operator.mul, ans)
    print(int(result%1000000007))
