#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> broken(M);
  vector<long long> fib(3);
  bool flag = true;
  for (int i = 0; i < M; i++) {
    cin >> broken[i];
    if (i > 0 && broken[i] == broken[i - 1] + 1) {
      flag = false;
    }
  }
  fib[0] = 1;
  fib[1] = 1;
  fib[2] = 0;
  int c = 0;
  if (flag) {
    for (int i = 0; i < N - 1; i++) {
      if (c < M && i + 1 == broken[c]) {
        fib[1] = fib[0];
        i++;
        c++;
        continue;
      }
      fib[2] = fib[1] + fib[0];
      fib[0] = fib[1];
      fib[1] = fib[2] % mod;
    }
  }
  if (N == 1)
    cout << 1 << endl;
  else {
    cout << fib[2] % mod << endl;
  }
}
