#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<bool> safe(n + 1, true);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    safe[a] = false;
  }
  vector<ll> dp(n + 1);
  dp[0] = 1;
  dp[1] = safe[1];
  for (int i = 2; i <= n; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) * safe[i];
  }
  cout << dp[n] % MOD << endl;
  return 0;
}
