# -*- coding: utf-8 -*-

def fb(num):
    p, q = 1, 0
    for _ in range(num):
        p, q = p + q, p
    return q

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

a.append(n)
s = 1
am = 0

for i in a:
    if i - am == 1 and i != 1:
        print(0)
        exit()

    if i == a[0]:
        s *= fb(i)

    elif i == a[-1]:
        s *= fb(i - am)

    else:
        s *= (fb(i - am - 1))
    
    am = i

s = s % 1000000007
print(s)