import sys
n, m = map(int, input().split())
a_list = []
for i in range(m):
    a_i = int(input())
    a_list.append(a_i)
    a_list = list(set(a_list))
#print(n, m, a_list)
#print(a_list)
m = len(a_list)
flag = 0

def stepup(x):
    #x段
    ans = 0
    for i in range(x):
        if i==0:
            two_before=1
            ans=1
        elif i==1:
            one_before=2
            ans=2
        else:
            #print(two_before, one_before)
            ans = one_before+two_before
            two_before = one_before
            one_before = ans
    return(ans)
        
a_list.sort()
#print(stepup(5))
#print(a_list)
for i in range(m):
    if i==0:
        if a_list[i]==1:
            count = 1
            continue
        else:
            count = stepup(a_list[0]-1)
    else:
        if a_list[i]-a_list[i-1]==1:
            #print(a_list[i], a_list[i-1])
            flag = 1
            break
        else:
            #print(stepup(23))
            #print(i, stepup(a_list[i]-a_list[i-1]))
            count *= stepup(a_list[i]-a_list[i-1]-2)
    #print(count)
if n-a_list[i]==1:
    pass
else:
    count *= stepup(n-a_list[i]-1)
#print(count)

if flag==1:
    print(0)
else:
    print(count%1000000007)
#print((stepup(20)**4 * stepup(10))%1000000007)
