#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1e18;
const long long dx4[4] = {1, 0, -1, 0};
const long long dy4[4] = {0, 1, 0, -1};
const long long dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const double pi = acos(-1);
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using Graph = vector<vector<long long>>;
void solve() {
  std::ifstream in("sample.txt");
  std::cin.rdbuf(in.rdbuf());
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m + 100);
  for (long long i = 0; i < m; i++) cin >> a[i];
  long long fib[100010];
  for (long long i = 0; i <= 100010; i++) {
    if (i == 0) {
      fib[i] = 1;
    } else if (i == 1) {
      fib[i] = 1;
    } else {
      fib[i] = fib[i - 1] + fib[i - 2];
      fib[i] %= MOD;
    }
  }
  long long ans = 1;
  for (long long im = 0; im <= m; im++) {
    long long da = 0;
    if (im == 0)
      da = a[im] - (-1) - 2;
    else if (im == m)
      da = (n + 1) - a[im - 1] - 2;
    else
      da = a[im] - a[im - 1] - 2;
    (da >= 0) ? ans *= fib[da] : ans *= 0;
    ans %= MOD;
  }
  cout << ans << endl;
}
signed main() {
  solve();
  return 0;
}
