#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[N];
  long long dan[N];
  long long out = 0;
  bool isZero = false;
  for (long long i = 0; i < (long long)(M); i++) {
    dan[i] = 0;
    cin >> a[i];
    if (i > 0 && a[i] == a[i - 1] + 1) {
      isZero = true;
      break;
    }
    dan[a[i] - 1] = 1;
  }
  long long mod = 1000000007;
  long long A[N];
  if (!isZero) {
    for (long long i = 0; i < (long long)(N); i++) {
      if (dan[i] == 1)
        A[i] = 0;
      else if (i == 0)
        A[i] = 1;
      else if (i == 1)
        A[i] = 2;
      else
        A[i] = (A[i - 1] + A[i - 2]) % mod;
    }
    out = A[N - 1] % mod;
  }
  cout << out << endl;
  return 0;
}
