#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> broken(n + 1);
  for (int i = 0; i < (int)m; i++) {
    long long a;
    cin >> a;
    broken[a] = 1;
  }
  vector<long long> dp(n + 2);
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) {
    if (broken[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
}
