#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long k;
  bool ng[n + 1];
  for (long long i = 0; i < n; i++) {
    ng[i] = false;
  }
  for (long long i = 0; i < m; i++) {
    cin >> k;
    ng[k] = true;
  }
  long long ans[n + 1];
  ans[0] = 0;
  ans[1] = 1;
  ans[2] = 2;
  if (ng[1]) {
    ans[1] = 0;
    ans[2] = 1;
  }
  if (ng[2]) {
    ans[2] = 0;
  }
  for (long long i = 1; i < n; i++) {
    ans[i] %= 1000000007;
    ans[i + 1] %= 1000000007;
    ans[i + 2] = ans[i + 1] + ans[i];
    if (ng[i]) ans[i + 2] -= ans[i];
    if (ng[i + 1]) ans[i + 2] -= ans[i + 1];
    ans[i + 2] %= 1000000007;
  }
  cout << ans[n];
}
