#include <bits/stdc++.h>
using namespace std;
template <class T>
T GCD(T m, T n) {
  T temp;
  while (m % n != 0) {
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}
template <class T>
T LCM(T m, T n) {
  return m * n / GCD(m, n);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n + 1, true);
  for (int i = 0; i < m; i++) {
    int l;
    cin >> l;
    a[l] = false;
  }
  vector<long long int> dp(n + 1, 0);
  dp[0] = 1;
  if (a[1]) {
    dp[1] = 1;
  }
  for (int i = 2; i < n + 1; i++) {
    if (a[i - 1]) {
      dp[i] += dp[i - 1];
    }
    if (a[i - 2]) {
      dp[i] += dp[i - 2];
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
