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