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