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

t = 1000000007
ans = 1


def Fib(n):
    a, b = 1, 2
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n - 2):
            a, b = b, a + b
        return b


if m == 1:
    ans = ans * Fib(a[0] - 1) * Fib(n - a[0] - 1)
else:
    for i in range(m):
        # 最初の段
        if i == 0:
            ans = ans * Fib(a[i] - 1)
        # 二段壊れは0
        elif a[i] - a[i - 1] == 1:
            ans = 0
            break
        # 最後の段
        elif i == m - 1:
            if a[i] != n - 1:
                ans = ans * Fib(n - a[i] - 1)
                break
            else:
                break
        # 壊れ段の間
        else:
            ans = ans * Fib(a[i] - a[i - 1] - 2)

print(ans % t)
