#include <bits/stdc++.h>
static const long long MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n + 1);
  vector<int> d(m);
  bool flag = false;
  for (int i = 0; i < (int)(m); i++) cin >> d[i];
  v[0] = 1;
  v[1] = 1;
  for (int i = 2; i <= n; i++) {
    flag = false;
    for (int j = 0; j < (int)(m); j++) {
      if (i == d[j]) {
        flag = true;
      }
    }
    if (flag) {
      v[i] = 0;
    } else {
      v[i] = (v[i - 1] % 1000000007 + v[i - 2] % 1000000007) % 1000000007;
    }
  }
  cout << v[n] % 1000000007;
  return 0;
}
