n, m = list(map(int, input().split(' ')))
a = []
c = 1
p = 0

for i in range(m):
    a.append(int(input()))

while p < n:
    if p+2 not in a:
        p += 2
    elif p+1 not in a:
        p += 1
    else:
        c = 0
        break
    c += 1

print(c%1000000007)