#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<bool> broken(n + 1, false);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    broken[a] = true;
  }
  vector<long long> count(n + 1, 0LL);
  count[0] = 1LL;
  count[1] = broken[1] ? 0LL : 1LL;
  for (int i = 2; i <= n; --i) {
    if (broken[i]) {
      count[i] = 0;
    } else {
      count[i] = (count[i - 1] + count[i - 2]) % 1000000007;
    }
  }
  cout << count[n] << endl;
  return 0;
}
