n, m = map(int, input().split(' '))
a = []
for i in range(m):
    a.append(int(input()))

def t(current, n):
    if current == n:
        return 1
    if current in a:
        return 0
    p1, p2 = 0, 0
    if current + 1 not in a:
        p1 = t(current + 1, n)
    if current + 2 <= n and current + 2 not in a:
        p2 = t(current + 2, n)
    return p1 + p2

result = 1
a.append(n - 1)
for index in range(len(a)):
    if index == 0:
        a1 = 0
    else:
        a1 = a[index - 1] + 1
    a2 = a[index] + 1
    p_step1 = t(a1 + 1,  a2)
    p_step2 = t(a1 + 2,  a2)
    result = (result * (p_step1 + p_step2)) % 1000000007
 
print(result)
