#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000009;
int main() {
  int n, m;
  cin >> n >> m;
  int a[100100] = {0};
  if (m != 0) {
    for (int i = 0; i < m; i++) cin >> a[i];
  }
  bool b[100100] = {0};
  if (m != 0) {
    for (int i = 0; i < m; i++) {
      b[a[i]] = true;
    }
  }
  long long dp[100100] = {0};
  dp[0] = 1;
  for (int i = 0; i < 100100; i++) {
    if (b[i] == true) continue;
    if (b[i + 1] == true) {
      dp[i + 1] = dp[i];
    } else {
      (dp[i + 1] += dp[i]) %= MOD;
    }
    if (b[i + 2] == true) {
      dp[i + 2] = dp[i];
    } else {
      (dp[i + 2] += dp[i]) %= MOD;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
