#include <bits/stdc++.h>
long long fib(int n) {
  if (n == 0) {
    return 1;
  }
  n++;
  int a = 0, b = 1;
  for (int i = 0; i < n; i++) {
    int t = a + b;
    b = a;
    a = t;
  }
  return a;
}
int main() {
  const int mod = 1000000007;
  int n, m;
  std::cin >> n >> m;
  std::vector<int> a(m);
  for (int i = 0; i < m; i++) {
    std::cin >> a[i];
  }
  int current = 0;
  long long ans = 1;
  for (auto c : a) {
    ans *= fib(c - 1 - current);
    ans %= mod;
    current = c + 1;
  }
  ans *= fib(n - current);
  ans %= mod;
  std::cout << ans << std::endl;
}
