#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
int n, m, a[maxn], dp[maxn];
bool b[maxn];
bool cmp(int x, int y) { return x > y; }
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    a[i] = read();
  }
  dp[1] = 1, dp[2] = 2;
  for (int i = 1; i <= m; i++) {
    b[a[i]] = true;
  }
  if (b[1] == true) {
    dp[1] = 0;
    dp[2] = 1;
  }
  for (int i = 3; i <= n; i++) {
    if (b[i]) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= mod;
    }
  }
  cout << (dp[n] + mod) % mod;
  return 0;
}
