mod = 10**9 + 7

n, m = map(int, input().split())
a = [0] * (n + 1)

pre_a = -1
flag = True
for i in range(m):
    tmp_a = int(input())
    if pre_a + 1 == tmp_a:
        flag = False
    a[tmp_a] = 1
    pre_a = tmp_a

l = [0] * (n + 1)

l[n] = 1
l[n-1] = 1

for i in range(2, n+1):
    num = n - i
    if a[num] == 0:
        l[num] = (l[num+1] + l[num+2]) % mod
    else:
        l[num] = 0

if flag:
    print(l[0])
else:
    print(0)