#include <bits/stdc++.h>
using namespace std;
const int E = static_cast<int>(1e9 + 7);
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> dp(n + 5, -1);
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    dp[tmp] = 0;
  }
  if (dp[1] == 0) dp[2] = 1;
  for (int i = 3; i <= n; i++) {
    if (dp[i] == -1) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % E;
    }
  }
  cout << dp[n] << endl;
}
