#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int M;
  cin >> N >> M;
  int a[M];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  int f[N + 2];
  f[N + 1] = 0;
  for (int i = 0; i <= N; i++) {
    f[i] = 1;
  }
  const int mod = 1000000007;
  for (int i = 0; i < M; i++) {
    f[a[i]] = 0;
  }
  for (int i = N - 1; 0 <= i; i--) {
    if (f[i] == 0) {
      continue;
    }
    f[i] = f[i + 1] + f[i + 2];
  }
  cout << f[0] % mod;
  cout << endl;
  return 0;
}
