def calcPatt(steps):
    if steps <= 1:
        return 1
    elif steps == 2:
        return 2
    ll = {}
    # ここからは3以上
    for i in range(steps)[::-1]:
        if i + 1 == steps:
           ll[i] = 1
        elif i + 2 ==steps:
            ll[i] = 2
        else:
            ll[i] = ll[i+1] + ll[i+2]
    
    return ll[0]

N, M = map(int,(input().split()))

before = 0
ll = []
for i in range(M):
    a = int(input()) - 1
    stepRenge = a  - before
    ll.append(calcPatt(stepRenge))
    before = a + 2
    

# 最後の一回分が残ってるのでやる
stepRenge = N  - before
ll.append(calcPatt(stepRenge))

pro = 1
for i in ll:
    pro = (pro * i) % 1000000007
 
print(pro)