#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}
using ll = long long int;
int main(void) {
  int n;
  int m;
  cin >> n >> m;
  vector<int> v(n + 1);
  vector<int> a(n + 1);
  for (int i = 0; i < n + 1; i++) {
    v[i] = 0;
    a[i] = 0;
  }
  int prev;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    if (i > 0) {
      if (prev + 1 == x) return 0;
      prev = x;
    }
    a[x] = 1;
  }
  v[0] = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      v[i + 1] = (v[i + 1] + v[i]) % 1000000007;
      if (i + 2 <= n) v[i + 2] = (v[i + 2] + v[i]) % 1000000007;
    }
  }
  std::cout << v[n] << std::endl;
  return 0;
}
