#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
vector<ll> dp;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<int> a(m, 0);
  for (ll i = 0; i < m; i++) {
    cin >> a[i];
  }
  dp.resize(n, 0);
  dp[0] = 1;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    if (a[j] == i) {
      if (j != m - 1) j++;
      continue;
    }
    if (i == 1) dp[i] = dp[i - 1];
    if (i > 1) dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] % mod << endl;
  return 0;
}
