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