def fib(n):
    if n == 1 or n == 2:
        return 1
    return fib(n - 1) + fib(n - 2)

pipi = 1

n,m = map(int,input().split())
a = []
b = []
flag = 0

for i in range(m):
    a.append(int(input()))

for i in range(m):
    if i == 0:
        if a[0] > 1:
            b.append(a[0]-1)

    if m != 1 and i!=0:
        if a[i]-a[i-1]-2 <= -1:
            flag = 1
            break
        else:
            b.append(a[i]-a[i-1]-2)

    if i == m-1:
        if a[i] < n:
            b.append(n-a[i]-1)

if flag == 0:
    for i,value in enumerate(b):
        if value >= 0:
            pipi *= fib(value+1)
if flag == 0:
    print(pipi % 1000000007)
else:
    print("0")