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

NUM = int(10**9 + 7)

split = [[0, nums[0] - 1]]
for i in range(1, m):
    split.append([nums[i - 1] + 1, nums[i] - 1])
split.append([nums[-1] + 1, n])

n_steps = [h - l for l, h in split]

counts = [1, 1, 2]
for _ in range(max(n_steps) - 2):
    c = counts[-1] + counts[-2]
    counts.append(c)

if min(n_steps) < 0:
    print(0)
else:
    res = 1
    for s in n_steps:
        res *= counts[s]
        res %= NUM
    print(res)