#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1000000007;
vector<bool> safe(10010, true);
ll fnc(int x) {
  if (x == 0)
    return 1;
  else if (!safe[x])
    return 0;
  else if (x == 1)
    return 1;
  return (fnc(x - 2) + fnc(x - 1)) % INF;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (m); i++) {
    int a;
    cin >> a;
    safe[a] = false;
  }
  cout << fnc(n) << endl;
  return 0;
}
