#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000007;
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[M];
  vector<bool> j(N, true);
  for (int i = 0; i < (int)(M); i++) {
    cin >> a[i];
    j[a[i]] = false;
  }
  long long dp[N + 1];
  dp[0] = 0;
  if (j[1] == true) {
    dp[1] = 1;
    dp[2] = 2;
  } else {
    dp[1] = 0;
    dp[2] = 1;
  }
  for (long long i = 3; i <= N; i++) {
    if (j[i - 1] == true && j[i - 2] == true) {
      dp[i] = dp[i - 1] + dp[i - 2];
    } else if (j[i - 1] == false && j[i - 2] == true) {
      dp[i] = dp[i - 2];
    } else if (j[i - 1] == true && j[i - 2] == false) {
      dp[i] = dp[i - 1];
    } else {
      dp[i] = 0;
    }
  }
  long long ans = dp[N] % INF;
  cout << ans << endl;
}
