# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = []
cr = 0
for i in range(m):
    a.append(int(input()))
s =[]
if 1 in a[:2]:
    s.append(0)
else:
    s.append(1)
if 2 in a[:3]:
    s.append(0)
else:
    s.append(1+s[0])
for i in range(2,n):
    if i+1 in a[cr:]:
        cr += 1
        s.append(0)
    elif i in a[cr:]:
        s.append(s[i-2]% 1000000007)
    elif i-1 in a[cr:]:
        s.append(s[i-1]% 1000000007)
    else:
        s.append((s[i-1] + s[i-2])% 1000000007)
print(s[n-1] % 1000000007)
