#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 10, MOD = 1e9 + 7;
int n, m, x, f[M], a[M];
int dfs(int step) {
  if (!step) return 1;
  if (f[step]) return f[step];
  int re = 0;
  if (step >= 2 && !a[step - 2]) re = ((long long)re + dfs(step - 2)) % MOD;
  if (step >= 1 && !a[step - 1]) re = ((long long)re + dfs(step - 1)) % MOD;
  return f[step] = re;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) scanf("%d", &x), a[x] = 1;
  printf("%d", dfs(n));
  return 0;
}
