#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < (m); i++) cin >> a[i];
  reverse((a).begin(), (a).end());
  vector<long long> dp(n + 1, -1);
  if (!a.empty() && a.back() - 1 == 0) {
    dp[0] = 0;
    a.pop_back();
  }
  if (!a.empty() && a.back() - 1 == 1) {
    dp[1] = 0;
    a.pop_back();
  }
  if (dp[0] != 0) dp[0] = 1;
  if (dp[1] != 0) dp[1] = dp[0] + 1;
  for (long long i = 0; i < (n - 2); i++) {
    if (!a.empty() && a.back() - 1 != i + 2) {
      dp[i + 2] = (dp[i + 1] + dp[i]) % 1000000007;
      dp[i + 2] %= 1000000007;
    } else {
      dp[i + 2] = 0;
      a.pop_back();
    }
  }
  cout << dp[n - 1] << endl;
}
