import sys
sys.setrecursionlimit(1000000)

n,m = map(int,input().split())
# 差が0だと通れない
tmp=10000000
a_list=[]
for i in range(m):
    a=int(input())
    a_list.append(a)
    if abs(tmp-a)==1:
        print(0)
        exit()
    tmp=a

def count(now,s,e):
    if now > e:
        return 0
    if now == e:
        return 1
    cnt=0
    cnt+=count(now+1,s,e)
    cnt+=count(now+2,s,e)
    return cnt


c_mod=1000000007
start=0
end=0
ans=1
for a in a_list:
    # 各部分の移動方法
    end=a-1
    ans=ans*count(start,start,end)%c_mod
    start=a+1
if end<n:
    end=n
    ans=ans*count(start,start,end)%c_mod
print(ans)
