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