#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
vector<long long> dp(100001, -1);
vector<bool> broken(100001);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    broken.at(a) = true;
  }
  dp.at(0) = 1;
  dp.at(1) = 1;
  for (int i = 1; i <= N; i++) {
    if (broken.at(i)) {
      dp.at(i) = 0;
    } else {
      dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % MOD;
    }
  }
  cout << dp.at(N) << endl;
}
