N, M = list(map(int, input().split()))

a = [int(eval(input())) for _ in range(M)]



class comb():

  F = [1, 1]

  Fi = [1, 1]

  I = [0, 1]

  def __init__(self, num, mod):

    self.MOD = mod

    for i in range(2, num + 1):

      self.F.append((self.F[-1] * i) % mod)

      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)

      self.Fi.append(self.Fi[-1] * self.I[i] % mod)

  def com(self, n, k):

    if n < k: return 0

    if n < 0 or k < 0: return 0

    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD





MOD = 10 ** 9 + 7



for i in range(1, M):

  if a[i] - a[i - 1] == 1:

    print((0))

    exit()



com = comb(200000, MOD)

ans = 1

x = 0

a = a + [N + 1]



for i in a:

  t = i - 1 - x

  at = 0

  for j in range(t // 2 + 1):

    k = t - j

    at = at + com.com(k, j) % MOD

  ans = ans * at % MOD

  x = i + 1

  



print(ans)
N, M = list(map(int, input().split()))

a = [int(eval(input())) for _ in range(M)]

MOD = 10 ** 9 + 7

D = [0] * (N + 1)

D[0] = 1



a.append(10 ** 15)

c = 0

for i in range(1, N + 1):

  if a[c] == i:

    c += 1

    continue

  D[i] = D[i - 1]

  if i - 2 >= 0:

    D[i] = (D[i] + D[i - 2]) % MOD



print((D[-1]))





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


class comb:
    F = [1, 1]
    Fi = [1, 1]
    I = [0, 1]

    def __init__(self, num, mod):
        self.MOD = mod
        for i in range(2, num + 1):
            self.F.append((self.F[-1] * i) % mod)
            self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
            self.Fi.append(self.Fi[-1] * self.I[i] % mod)

    def com(self, n, k):
        if n < k:
            return 0
        if n < 0 or k < 0:
            return 0
        return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


MOD = 10**9 + 7
for i in range(1, M):
    if a[i] - a[i - 1] == 1:
        print((0))
        exit()
com = comb(200000, MOD)
ans = 1
x = 0
a = a + [N + 1]
for i in a:
    t = i - 1 - x
    at = 0
    for j in range(t // 2 + 1):
        k = t - j
        at = at + com.com(k, j) % MOD
    ans = ans * at % MOD
    x = i + 1
print(ans)

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7
D = [0] * (N + 1)
D[0] = 1
a.append(10**15)
c = 0
for i in range(1, N + 1):
    if a[c] == i:
        c += 1
        continue
    D[i] = D[i - 1]
    if i - 2 >= 0:
        D[i] = (D[i] + D[i - 2]) % MOD
print((D[-1]))

- - -class comb: -    F = [1, 1] -    Fi = [1, 1] -    I = [0, 1] - -    def __init__(self, num, mod): -        self.MOD = mod -        for i in range(2, num + 1): -            self.F.append((self.F[-1] * i) % mod) -            self.I.append(mod - self.I[mod % i] * (mod // i) % mod) -            self.Fi.append(self.Fi[-1] * self.I[i] % mod) - -    def com(self, n, k): -        if n < k: -            return 0 -        if n < 0 or k < 0: -            return 0 -        return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD - - -for i in range(1, M): -    if a[i] - a[i - 1] == 1: -        print((0)) -        exit() -com = comb(200000, MOD) -ans = 1 -x = 0 -a = a + [N + 1] -for i in a: -    t = i - 1 - x -    at = 0 -    for j in range(t // 2 + 1): -        k = t - j -        at = at + com.com(k, j) % MOD -    ans = ans * at % MOD -    x = i + 1 -print(ans) +D = [0] * (N + 1) +D[0] = 1 +a.append(10**15) +c = 0 +for i in range(1, N + 1): +    if a[c] == i: +        c += 1 +        continue +    D[i] = D[i - 1] +    if i - 2 >= 0: +        D[i] = (D[i] + D[i - 2]) % MOD +print((D[-1]))