#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> Typical(m + 5);
  for (int i = (0); (i) < (m); i++) {
    int x;
    cin >> x;
    Typical[x] = 1;
  }
  vector<int> ans(n + 5);
  ans[n] = 1;
  for (int i = (n - 1); i >= 0; i--) {
    if (Typical[i]) {
      ans[i] = 0;
      continue;
    }
    ans[i] += (ans[i + 1] + ans[i + 2]) % 1000000007;
  }
  cout << ans[0];
  return 0;
}
