#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int a[maxn];
bool vis[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    vis[x] = 1;
  }
  a[0] = 1;
  if (vis[1] == 0) a[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (vis[i] == 0) a[i] = (a[i - 1] + a[i - 2]) % mod;
  }
  cout << a[n] << endl;
  return 0;
}
