n,m=map(int,input().split())
flag=False
a=[int(input()) for i in range(m)]
for i in range(m-1):#answer 0
    if a[i+1]-a[i]==1:
        flag=True

def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 0
    for _ in range(num+1):
        a, b = a + b, a
    return b

if m!=0:
    key=fb(a[0]-1)

if m!=0:
    if key==0: key=1

for i in range(m-1):
    key*=fb(a[i+1]-a[i]-2)

if m!=0:
    key*=fb(n-a[len(a)-1]-1)

if flag==True:
    print(0)
elif m==0:
    print(fb(n))
else:
    print(key%1000000007)
