#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  scanf("%lld %lld", &n, &m);
  vector<long long> ans(n + 1, 0), pos(n + 1, 0);
  for (int i = 0; i < m; i++) {
    long long x;
    scanf("%lld", &x);
    pos[x] = -1;
  }
  if (pos[1] != -1) ans[1] = 1;
  if (pos[2] != -1 && n >= 2) ans[2] = 1 + ans[1];
  for (int i = 3; i < n + 1; i++) {
    if (pos[i] == -1) continue;
    if (i - 1 > 0 && pos[i - 1] != -1 && ans[i - 1] != 0)
      ans[i] += (ans[i - 1]);
    if (i - 2 > 0 && pos[i - 2] != -1 && ans[i - 2] != 0) {
      ans[i] += (ans[i - 2]);
    }
  }
  long long ass = ans[n] % 1000000007;
  printf("%lld", ass);
  printf("\n");
  return;
}
int main() {
  solve();
  return 0;
}
