from sys import stdin
from itertools import accumulate

a,b = [int(x) for x in stdin.readline().rstrip().split()]
li = [int(stdin.readline().rstrip()) for _ in range(b)]

if a == 1:
    print(1)
    exit()

elif a == 2:
    if b == 0:
        print(2)
        exit()
    else:
        print(1) 
        exit()

for k in range(len(li)-1):
    if li[k] +1 == li[k+1]:
        print(0)
        exit()

def stair_cal(x):
    if x == 1:
        return(x)
    elif x == 2:
        return(x)
    elif x == 0:
        return(1)
    lin = [1,2]
    for i in range(2,x):
        lin.append(lin[i-2]+lin[i-1])
    return(lin[-1])

if b == 0:
    print(stair_cal(a)%(10**9+7))
    exit()

li2 = []

li2.append(li[0]-1)

for i in range(1,b):
    li2.append(li[i]-li[i-1]-1)

li2.append(a-li[-1])

point = 1

for e in range(len(li2)):
    point = point*stair_cal(li2[e])%(10**9+7)

print(point)