#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<vector<int> >;
using VVL = vector<vector<ll> >;
void Main() {
  int N, M;
  cin >> N >> M;
  int INF = 1000000007;
  VI a(M), dp(N + 1, 0);
  for (int i = 0; i < (M); ++i) {
    cin >> a[i];
    dp[a[i]] = -1;
  }
  dp[0] = 1;
  if (a[0] == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = (2); i <= (N); ++i) {
    if (dp[i] == -1) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % INF;
  }
  cout << dp[N] << endl;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
