#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  bool vis[100009] = {};
  long long a[100009] = {0, 1, 2};
  long long n, k, x;
  cin >> k >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    vis[x] = true;
  }
  for (int i = 3; i <= k; i++) {
    if (vis[1]) {
      a[1] = 0;
      a[2] = 1;
    }
    if (vis[2]) {
      a[1] = 1;
      a[2] = 0;
    }
    if (vis[i])
      a[i] = 0;
    else
      a[i] = (a[i - 1] % mod + a[i - 2] % mod) % mod;
  }
  cout << a[k];
}
