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
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])
print(cnt % 1000000007)