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

sum_dev = 1000000007

current = n
route_num = 0

before = -1
route_nums = [0]

def make_route_num(length):
    if length == 0:
        return 1
    if length == 1:
        return 1
    if length == 2:
        return 2
    else:
        minus1 = 1
        minus2 = 2
        fibo=0
        for i in range(2, length):
            fibo = minus1 + minus2
            minus2 = minus1
            minus1 = fibo
        return fibo
print()
for i, a_i in enumerate(a):
    if a_i - before == 1:
        print(0)
        exit()
    routes = make_route_num(a_i - 1 - route_nums[-1])
    route_nums.append(routes)
    before = a_i

routes = make_route_num(n - 1 - route_nums[-1])
route_nums.append(routes)

route_sum = 1
for route in route_nums[1:]:
    route_sum *= route % sum_dev
print(route_sum)