mod = 1000000007

def fib(n):
    a, b = 0, 1
    if n == 0:
        return a
    for _ in range(n - 1):
        a, b = b, a + b
    return b

# def feb(n):
#     if n == 0:
#         return 0
#     if n == 1:
#         return 1
#     k = (n + 1) / 2 if n % 2 else n / 2
#     fib_k = feb(k)
#     fib_k_1 = feb(k - 1)
#     return fib_k**2 + fib_k_1**2 if n % 2 else (2 * fib_k_1 + fib_k) * fib_k

    # if n==0:
    #     return 0
    # if n==1:
    #     return 1
    # else:
    #     return feb(n-1)+feb(n-2)
    # root = math.sqrt(5)
    # return int((1/root)*(((1+root)/2)**n - ((1-root)/2)**n))

def calculate(n, b):
    diff = [b[i+1] - b[i] - 1 for i in range(len(b)-1)]
    diff.insert(0, b[0])
    diff.append(n - b[-1])
    sum = 1
    for d in diff:
        if d == 0:
            return 0
        sum *= feb(d)%mod
        sum = sum%mod
    return sum


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

print(calculate(n, b))