#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math
import collections


def fib(n):
    return int((1 / math.sqrt(5)) * (math.pow((1 + math.sqrt(5)) / 2, n) - math.pow((1 - math.sqrt(5)) / 2, n)))


# for i in range(10):
#     print(fib(i))

N, M = map(int, sys.stdin.readline().rstrip().split(" "))
As = []
for i in range(M):
    a, = map(int, sys.stdin.readline().rstrip().split(" "))
    As.append(a)
As.append(N+1)
result = 1
current = 0
for a in As:
    diff = a - current - 1
    if diff == -1:
        print(0)
        exit(0)
    # 1: 1
    # 2: 2
    # 3: 3C0 + 2C1 = 3
    # 4: (1,1,1,1) (1,1,2) (1, 2, 1) (2, 1, 1), (2, 2): 4C4 + 3C1 + 2C2 = 1+ 3 + 1 = 5
    # 5: 5C0 + 4C1 + 3C2 = 1 + 4 + 3 = 8
    # 6: 6C0 + 5C1 + 4C2 + 3C3 = 1+5+6+1 = 13
    # 7: 7C0 + 6C1 + 5C2 + 4C3 = 1+6+10+4 = 21
    # print(current, a, fib(diff+1))
    result *= fib(diff+1)
    result %= 1000000007
    # print("res", result)
    current = a + 1
print(result)
exit(0)
