#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<bool> a(n + 1);
  for (long long i = 0; i < m; i++) {
    long long u;
    cin >> u;
    a[u] = true;
  }
  if (n == 1) {
    cout << 1 << endl;
  }
  vector<long long> st(n + 1);
  st[0] = 1;
  st[1] = 1;
  for (long long i = 2; i <= n; i++) {
    st[i] = (a[i - 1] ? 0 : st[i - 1]) + (a[i - 2] ? 0 : st[i - 2]);
    st[i] %= 1000000007;
  }
  cout << st[n] << endl;
  return 0;
}
