#include <bits/stdc++.h>
using namespace std;
int N = 0, M = 0;
long long MOD = pow(10, 9) + 7;
int main() {
  cin >> N >> M;
  vector<bool> flag(N + 1, true);
  vector<long long> DP(N + 1, 0);
  for (int i = 0; i < (int)(M); i++) {
    int a = 0;
    cin >> a;
    flag[a] = false;
  }
  DP[0] = 1;
  if (flag[1] == true) DP[1] = 1;
  for (int i = 0; i < (int)(N - 1); i++) {
    if (flag[i + 2] == true) DP[i + 2] = (DP[i + 1] + DP[i]) % MOD;
  }
  cout << DP[N] << endl;
}
