#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 1e9 + 7;
  int N, M;
  cin >> N >> M;
  vector<long long> p(N + 1, -1);
  for (int i = 0; i < M; i++) {
    int tmp;
    cin >> tmp;
    p[tmp] = 0;
  }
  for (int i = 0; i < N + 1; i++) {
    if (i == 0) {
      p[i] = 1;
    } else if (i == 1) {
      if (p[i] < 0) p[i] = 1;
    } else {
      if (p[i] < 0) p[i] = p[i - 1] + p[i - 2];
    }
  }
  long long ans = p[N] % mod;
  cout << ans << endl;
  return 0;
}
