import re
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    numerator = reduce(mul, range(n, n - r, -1))
    denominator = reduce(mul, range(1, r + 1))
    return numerator // denominator


def Step(num):
    ans = 0
    for i in range(num//2 + 1):
        ans += cmb(num-i, i)
    return ans


N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

if M > 0:
    step = ['1' for _ in range(a[0]-1)]
    for i in range(M-1):
        if a[i]+1 == a[i+1]:
            print(0)
            exit()
        else:
            step += (['2'] + ['1' for _ in range(a[i]+1, a[i+1]-1)])

    step += (['2'] + ['1' for _ in range(a[M-1]+1, N)])

elif M == 0:
    step = ['1' for _ in range(N)]

one_one = list(map(len, re.findall(r'1+', ''.join(step))))

ans = 1
for i in one_one:
    ans *= Step(i)

print(ans % 1000000007)
