#include <bits/stdc++.h>
const long long int mod = 1e9 + 7;
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1, true);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a[x] = false;
  }
  vector<long long int> dp(n + 1);
  dp[n] = 1;
  dp[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (a[i]) {
      dp[i] = dp[i + 1] + dp[i + 2];
      dp[i] %= mod;
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[0] << endl;
  return 0;
}
