import sys

def fib(x):
    if x > 1:
        return fib(x-1) + fib(x-2)
    else:
        return 1

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

for k in range(1,M):
    if a[k] - a[k-1] == 1:
        print(0)
        sys.exit()

count = 1
if M > 0:
    stairs = a[0] - 1
    c = fib(stairs) #組み合わせ
    count = count*c

    if M > 1:
        for i in range(1,M):
            stairs = a[i] - a[i-1] - 1
            c = fib(stairs)#組み合わせ
            count = count*c

    stairs = N - a[M-1] - 1
    c = fib(stairs)
    count = count*c

else:
    c = fib(N)
    count = count*c

d = count%1000000007
print(d)
