#include <bits/stdc++.h>
#pragma warning(disable : 6031)
#pragma warning(disable : 4101)
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const double PI = acos(-1);
const int MAXN = 1000005;
const long long MOD = 1000000007ll;
long long n, m, x, A[MAXN], DP[MAXN];
int main() {
  scanf("%lld%lld", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &x);
    A[x] = 1;
  }
  if (n > 1 && !A[n - 1]) {
    DP[n - 1] = 1;
  }
  if (n > 2 && !A[n - 2]) {
    DP[n - 2] = 1 + DP[n - 1];
  }
  for (int i = n - 3; i >= 0; i--) {
    if (!A[i]) {
      DP[i] = (DP[i + 1] + DP[i + 2]) % MOD;
    }
  }
  printf("%lld\n", DP[0]);
  return 0;
}
