#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
ll MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<ll> dp(n + 5, 0);
  dp[0] = 1;
  dp[1] = (a[0] == 1) ? 0 : 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = max(dp[i], dp[i - 1] + dp[i - 2]) % MOD;
    for (int j = 0; j < m; j++) {
      if (i == a[j]) {
        dp[i] = 0;
        break;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
