from operator import itemgetter
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
stairs = [0] * (n + 1)
a = [int(input()) for i in range(m)]
mod = (10 ** 9 + 7)
stairs[0] = 1

if n == 1:
    print(1)
    exit()
if n == 2:
    print(2)
    exit()

stairs[1] = 1
for i in a:
    stairs[i] = "#"


for i in range(2, n + 1):
    if stairs[i] != "#":
        #　両方セーフ
        if stairs[i-1] != "#" and stairs[i-2] != "#":
            stairs[i] += stairs[i-1] + stairs[i-2]
        # 両方アウト
        elif stairs[i-1] == "#" and stairs[i-2] == "#":
            pass
        # 1マス前アウト
        elif stairs[i-1] == "#" and stairs[i-2] != "#":
                stairs[i] += stairs[i-2]
        # 2マス前アウト
        elif stairs[i-2] == "#" and stairs[i-1] != "#":
                stairs[i] += stairs[i-1]

        stairs[i] = stairs[i] % mod


print(stairs[n] % mod)
