#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 1000000007;
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  queue<int> pq;
  for (int i = 0; i < M; i++) cin >> A.at(i);
  for (int i = 0; i < M; i++) pq.push(A.at(i));
  int dp[1000100];
  dp[1] = 1;
  dp[2] = 2;
  if (pq.front() == 1) {
    dp[1] = 0;
    pq.pop();
  }
  if (pq.front() == 2) {
    dp[2] = 0;
    pq.pop();
  }
  if (dp[1] == 0) {
    dp[2] = 1;
  }
  for (int i = 1; i <= N - 1; i++) {
    dp[i + 2] = dp[i + 1] + dp[i];
    dp[i + 2] %= mod;
    if (i + 2 == pq.front()) {
      dp[i + 2] = 0;
      pq.pop();
    }
  }
  cout << dp[N] << endl;
}
