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