#129
N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
f=[1,2,3,5,8]
def cu(x):
    global f
    if len(f)<x:
        for i in range(len(f),x):
            f.append( f[i-1]+f[i-2] )
    return f[x-1]

a_d=[a[0]-1]
for i in range(M-1):
    a_d.append( a[i+1]-a[i]-1 )
a_d.append(N-a[-1]-1)
if 0 in a_d[1:]:
    print(0)
    exit(0)
else:
    count=1
    for i in range(M+1):
        if i==0 and a_d[0]!=0:
            count=cu(a_d[0])
        elif i==M:
            count=count*cu(a_d[-1])
        else:
            if a_d[i]>=3:
                count=count*cu(a_d[i]-1)
print(count%(10**9+7))