#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
class CTypicalStairs {
 public:
  void solve(std::istream &in, std::ostream &out) {
    int n, m, x;
    in >> n >> m;
    vector<bool> forbidden(n + 5);
    for (int i = 0; i < (int)(n); ++i) {
      in >> x;
      forbidden[x] = true;
    }
    vector<long long> dp(n + 1);
    dp[0] = 1;
    for (int i = (int)(1); i <= (int)(n); ++i) {
      if (forbidden[i]) continue;
      dp[i] = dp[i] + dp[i - 1];
      if (i >= 2) dp[i] = dp[i] + dp[i - 2];
      dp[i] %= MOD;
    }
    out << dp[n] << endl;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  CTypicalStairs solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
