#include <bits/stdc++.h>
using namespace std;
long long fib[100] = {0};
long long test(int n) {
  fib[0] = 1;
  fib[1] = 1;
  if (fib[n])
    return fib[n];
  else {
    fib[n] = test(n - 1) + test(n - 2);
    return fib[n];
  }
}
int main() {
  long long a;
  for (int i = 0; i < 100; i++) a = test(i);
  int n, m;
  cin >> n >> m;
  int broken[m + 1];
  if (m > 0) {
    for (int i = 0; i < m; i++) cin >> broken[i];
  }
  broken[m] = 0;
  long long now = 0, step = 0, ans = 1;
  long long int x;
  x = pow(10, 9) + 7;
  int j = 0;
  while (now < n) {
    if (now + 1 != broken[j]) {
      now++;
      ++step;
    } else {
      if (now + 2 == broken[j + 1]) {
        ans = 0;
        break;
      } else {
        ans *= fib[step];
        ans %= x;
        j++;
        now += 2;
        step = 0;
      }
    }
  }
  ans *= fib[step];
  ans %= x;
  cout << ans << endl;
  return 0;
}
