#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int n, m, dp[100000];
  cin >> n >> m;
  vector<int> x(m, 0);
  for (int(i) = 0; i < (m); i++) cin >> x.at(i);
  dp[0] = 1;
  if (x.at(0) == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    for (int j = 0; j < m; j++) {
      if (i == x.at(j)) {
        dp[i] = 0;
        break;
      }
    }
  }
  cout << dp[n];
}
