#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> f(n + 1);
  for (int i = (0); i < (n + 1); ++i) {
    int tmp;
    cin >> tmp;
    f[tmp] = true;
  }
  vector<long long> dp(n + 2);
  long long int con = 1000000007;
  dp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (f[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i + 1] + dp[i + 2]) % con;
  }
  cout << dp[0] << endl;
}
