#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int buf;
    cin >> buf;
    v.push_back(buf);
  }
  vector<long> dp(n + 1);
  dp[0] = 1;
  dp[1] = 1;
  if (v[0] == 1) dp[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (find(v.cbegin(), v.cend(), i) == v.cend())
      dp[i] = dp[i - 2] + dp[i - 1];
    else
      dp[i] = 0;
    dp[i] = dp[i] % 1000000007;
  }
  cout << dp[n] << endl;
  return 0;
}
