#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000000 + 7;
int n, m;
bool a[100005];
long long f[100005];
int solve(int x) {
  if (a[x]) return 0;
  if (f[x] != 0) return f[x];
  return f[x] = (solve(x - 1) + solve(x - 2)) % MOD;
}
int main() {
  scanf("%d %d", &n, &m);
  int last = -1;
  while (m--) {
    int t;
    scanf("%d", &t);
    if (t == last + 1 || t == n) {
      printf("0");
      return 0;
    }
    a[t] = true, last = t;
  }
  f[0] = f[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i]) continue;
    f[i] = f[i - 1] + f[i - 2];
  }
  printf("%d", solve(n));
  return 0;
}
