from functools import lru_cache


@lru_cache(maxsize=None)
def fib(n):
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)


def main():
    N, M = map(int, input().split())
    a = [-1] + [int(input()) for _ in range(M)]
    n = []
    for i in range(1, len(a)):
        if a[i - 1] + 1 == a[i]:
            return 0
        n.append(a[i] - a[i - 1] - 1)
    n.append(N - a[-1])
    ret = [fib(i) for i in n]
    ans = 1
    for i in ret:
        ans *= i
    return ans % 1000000007


if __name__ == "__main__":
    mm = 1000000007
    ans = main()
    print(ans)