#!/usr/bin/env python3
import sys

sys.setrecursionlimit(1000000)


def count(n):
    if n < 2:
        return 1
    return count(n - 1) + count(n - 2)


n, m, *a = map(int, open(0).read().split())
if sum(a[i + 1] == a[i] + 1 for i in range(m - 1)) > 0:
    print(0)
    exit()

a.append(n + 1)
c = -1
ans = 1
for i in a:
    ans = ans * count(i - c - 2) % (10**9 + 7)
    c = i
print(ans)
