#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  vector<int64_t> s(N + 1);
  s[0] = 1;
  int j = 0;
  for (int i = 1; i < N + 1; i++) {
    if (i == 1) {
      if (a[0] == 1) {
        j++;
        s[1] = 0;
      } else {
        s[1] = 1;
      }
    } else {
      if (a[j] == i) {
        j++;
        s[i] = 0;
      } else
        s[i] = (s[i - 2] + s[i - 1]);
    }
  }
  cout << s[N] % mod;
}
