n, m = map(int, input().split())

stair = [0]*n
s = 1
s_tmp = 2
for i in range(n):
    stair[i] = s
    s_tmp_tmp = s_tmp
    s_tmp = s_tmp+s
    s= s_tmp_tmp
    
#print(stair)

ans = 1
muri = 0
tmp = -1
for i in range(m):
    
    a = int(input())
    
    # 前の欠陥から連続の場合fail
    if a-1 == tmp:
        muri = 1
        break
    
    # 1段目スキップ
    elif a == 1:
        tmp = a
        continue
    # そうでないとき、まえの欠陥から正常な段数だけパターンがある
    else:
        ans *= stair[a-tmp-3]
        ans %= (10**9)+7
        #else:
        #    ans *= stair[a-tmp-3]
        #    ans %= (10**9)+7

    #print(ans)
    # 1段前を記録
    tmp = a

# 最後の階段
if n-tmp >= 2:
    ans *= stair[n-tmp-2]
    ans %= (10**9)+7

#print('last')
#print(ans)

if muri == 1:
    print(0)
else:
    if m == 0:
        print(stair[n-1]%(10**9+7))
    else:
        print(ans)

