#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(m, 0), my(n + 1, 0);
  my[0] = 1;
  vector<bool> t(n + 1, 1);
  for (long long int i = 0; i < m; i++) cin >> a[i];
  for (long long int i = 0; i < m; i++) {
    t[a[i]] = 0;
  }
  for (long long int i = 1; i < n + 1; i++) {
    if (t[i] == 0)
      continue;
    else {
      if (i == 1)
        my[i] = 1;
      else {
        my[i] = my[i - 1] + my[i - 2];
      }
    }
  }
  cout << my[n] % mod;
  return 0;
}
