#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> a_v(M);
  vector<long long int> f(N + 1, 0);
  for (int i = 0; i < M; i++) {
    cin >> a_v.at(i);
  }
  long long int j = 0;
  for (int i = 0; i <= N; i++) {
    if (a_v[j] == i) {
      j++;
    } else {
      if (i >= 2) {
        f[i] = f[i - 1] + f[i - 2];
      } else if (i == 1) {
        f[i] = f[i - 1] + 0;
      } else if (i == 0) {
        f[i] = 1;
      }
    }
  }
  for (int i = 0; i <= N; i++) {
  }
  cout << f[N] % 1000000007 << endl;
  return 0;
}
