#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> dp(N + 10, 0);
  vector<bool> flag(N + 10, true);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    flag[a] = false;
  }
  if (flag[1] == true) {
    dp[1] = 1;
  }
  for (int i = 2; i < dp.size(); i++) {
    if (flag[i] == true) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % inf;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
