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