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