#include <bits/stdc++.h>
using namespace std;
vector<int> a(100000);
vector<long long> dp(100000);
vector<bool> computed(100000, false);
const long long mod = 1e9 + 7;
long long solve(int n) {
  if (computed.at(n)) {
    return dp.at(n);
  }
  for (int i = 0; i < a.size(); i++) {
    if (a.at(i) == n) {
      dp.at(n) = 0;
      computed.at(n) = true;
      return 0;
    }
  }
  long long answer;
  switch (n) {
    case 1:
      answer = 1;
      break;
    case 2:
      answer = 2;
      break;
    default:
      answer = solve(n - 1) + solve(n - 2);
      break;
  }
  dp.at(n) = answer % mod;
  computed.at(n) = true;
  return dp.at(n);
}
int main() {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  long long answer = solve(N);
  cout << answer << endl;
}
