#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int MOD = 1000000007;
  int INF = 2147483647;
  vector<bool> broken(N + 10, false);
  for (int i = 0; i < M; i++) {
    int c;
    cin >> c;
    broken.at(c) = true;
  }
  int dp[100010];
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (broken[i]) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
}
