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

a = -2
for _ in range(M):
    new = int(input())
    if a+1 == new:
        print(0)
        exit()
    else:
        damaged.add(new)
        a = new
# これで連続ダメージの場合は以下の処理で存在しなくなった

a = 1
b = 2
i = 3
while i <= N-1:
    if i in damaged:
        i += 2
        a = 0
    else:
        tmp = b
        b = a + b
        a = tmp
        i += 1

print(b % (1000000007))
