#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 1000000007;
  int nmax = 100000;
  vector<int> fib(nmax + 1);
  fib.at(0) = 0;
  fib.at(1) = 1;
  for (int i = 2; i < nmax + 1; i++)
    fib.at(i) = (fib.at(i - 1) + fib.at(i - 2)) % mod;
  int n, m;
  cin >> n >> m;
  if (m == 0)
    cout << fib.at(n + 1) << endl;
  else {
    vector<int> a(m);
    for (int i = 0; i < (int)(m); i++) cin >> a.at(i);
    vector<int> b(m + 1);
    b.at(0) = a.at(0);
    b.at(m) = n - a.at(m - 1);
    for (int i = 1; i < m; i++) b.at(i) = a.at(i) - a.at(i - 1) - 1;
    int64_t ans = 1;
    for (int k : b) {
      ans *= fib.at(k);
      ans %= mod;
    }
    cout << ans << endl;
  }
}
