#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m, count = 0, ans = 0;
  cin >> n;
  cin >> m;
  vector<ll> a(m);
  for (int i = 0; i < (int)(m); i++) {
    cin >> a[i];
  }
  vector<ll> s(n + 1);
  s[0] = 1;
  int l = 0;
  for (int i = 1; i <= (int)(n); i++) {
    if (a[l] == i) {
      s[i] = 0;
      l++;
    } else if (i == 1)
      s[1] = 1;
    else
      s[i] = (s[i - 1] + s[i - 2]) % 1000000007;
  }
  cout << s[n] << endl;
}
