#include <bits/stdc++.h>
using namespace std;
long long gcd(long x, long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long x, long y) { return x * y / gcd(x, y); }
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
int main() {
  long long ans = 0, p[100010] = {}, mod = 1000000007;
  int N, M, A[100010] = {};
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> A[i];
  }
  int next = 0;
  p[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (i == A[next]) {
      p[i] = 0;
      next++;
      continue;
    }
    if (i == 1) {
      p[i] = 1;
    } else {
      p[i] = p[i - 1] + p[i - 2];
    }
  }
  ans = p[N] % mod;
  cout << ans << endl;
  return 0;
}
