#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int INF = 2000000000;
constexpr int mod = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> st(N + 1, 1);
  for (int i = (int)(0); i < (int)(M); ++i) {
    int a;
    cin >> a;
    st[a] = 0;
  }
  vector<ll> dp(N + 1);
  dp[0] = 1;
  for (int i = (int)(0); i < (int)(N); ++i) {
    for (int j = (int)(i + 1); j < (int)(min(N, i + 2)); ++j) {
      if (st[j]) {
        dp[j] += dp[i];
        dp[j] %= mod;
      }
    }
  }
  cout << dp[N] << "\n";
  return 0;
}
