#include <bits/stdc++.h>
using ll = int64_t;
using namespace std;
const int MOD = 1000000007;
int main() {
  int n, m, an = 0;
  cin >> n >> m;
  bool ok = true;
  vector<int> ste(n, 1);
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    ste[a - 1] = 0;
  }
  vector<int> ans(n, 0);
  ste[n - 1] ? ans[n - 1] = 1 : ans[n - 1] = 0;
  ste[n - 2] ? ans[n - 2] = 1 : ans[n - 2] = 0;
  for (int i = 0; i < (n - 2); ++i) {
    ans[n - 3 - i] = ans[n - 1 - i] + ans[n - 2 - i];
    ans[n - 3 - i] %= MOD;
    if (ste[n - 3 - i] == 0) ans[n - 3 - i] = 0;
  }
  int fans = ans[0] % MOD + ans[1] % MOD;
  cout << fans << endl;
  return 0;
}
