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