#include <bits/stdc++.h>
const double E = 1e-8;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<bool> sb(m + 1, false);
  for (int i = 0, a; i < m; ++i) {
    cin >> a;
    sb[a] = true;
  }
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  dp[1] = !sb[1];
  for (int i = 2; i <= n; ++i) {
    if (sb[i])
      dp[i] = 0;
    else {
      dp[i] = (dp[i - 1] % MOD + dp[i - 2] % MOD) % MOD;
    }
  }
  cout << dp[n] << '\n';
  return 0;
}
