#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
ll INF = 1000000099;
signed main() {
  ll n, m, x = -1, y = 0, ans = 1;
  cin >> n >> m;
  vector<ll> fib(n + 1), v(0);
  fib.at(0) = 1;
  fib.at(1) = 1;
  for (ll i = 2; i <= n; i++) {
    fib.at(i) = fib.at(i - 1) + fib.at(i - 2);
    fib.at(i) %= mod;
  }
  for (ll i = 0; i < m; i++) {
    cin >> y;
    if (y == x + 1) {
      cout << 0 << endl;
      return 0;
    }
    v.push_back(y - x - 2);
    x = y;
  }
  v.push_back(n - y - 1);
  for (ll i = 0; i < (ll)v.size(); i++) {
    ans *= (fib.at(v.at(i)) % mod);
  }
  cout << ans % mod << endl;
}
