#include <bits/stdc++.h>
using namespace std;
const long long DIV = 1e9 + 7;
const int NMAX = 1e5;
long long dp[NMAX] = {};
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  int c[n];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a, a + m);
  fill(c, c + n, 1);
  int i = 0;
  for (int j = 0; j < n; j++) {
    if (j == a[i]) {
      c[j] = 0;
      i++;
      if (i == m) {
        break;
      }
    }
  }
  dp[0] = 1;
  dp[1] = 1;
  bool isNG = false;
  for (int i = 2; i < n + 1; i++) {
    if (c[i] == 0 && c[i - 1] == 0) {
      isNG = true;
      break;
    }
    if (c[i - 1] == 0) {
      dp[i] = dp[i - 2];
    } else if (c[i - 2] == 0) {
      dp[i] = dp[i - 1];
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % DIV;
    }
  }
  if (isNG) {
    cout << 0 << endl;
  } else {
    cout << dp[n] << endl;
  }
  return 0;
}
