def count(b,a):
    c = 2
    d = 1
    for i in range(b - a):
        c,d = c+d,c
    return c
 
n,m = map(int,input().split())
li = []
for i in range(m):
    li.append(int(input()))
cnt = 1
if len(li) != 1:
    for i in range(len(li) - 1):
        if li[i+1] - li[i] == 1:
            cnt = 0
            break
        else:
            if i == 0:
                cnt *= count(li[1] - 1, 0)
            else:
                cnt *= count(li[i], li[i - 1])
else:
    cnt = count(li[0] - 2,1) *count(n - 1,li[0] + 2)
print(cnt % 1000000007)