#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a(1000010, 0);
vector<int> done(1000010, 0);
vector<int> flag(1000010, 0);
void dfs(int k) {
  flag.at(k) = 1;
  if (a.at(k) == 1) return;
  if (k == n) {
    a.at(n) = 1;
    return;
  }
  if (k > n) return;
  if (flag.at(k + 1) == 0) dfs(k + 1);
  if (flag.at(k + 2) == 0) dfs(k + 2);
  if (done.at(k) >= 1000000007) done.at(k) %= 1000000007;
  done.at(k) = done.at(k + 1) + done.at(k + 2);
}
int main() {
  cin >> n >> m;
  for (long long i = (0); i < (m); i++) {
    int x;
    cin >> x;
    a.at(x) = 1;
  }
  dfs(0);
  cout << done.at(0) << endl;
}
