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