#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll mod(ll a) { return (a % 1000000007); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
  ll n, m;
  cin >> n >> m;
  vl num(n);
  for (int i = 0; i < (m); i++) {
    ll x;
    cin >> x;
    x--;
    num[x] = -1;
  }
  if (n >= 2) {
    if (num[0] == 0 && num[1] == 0) {
      num[0] = 1;
      num[1] = 2;
    } else if (num[0] == -1 && num[1] == 0) {
      num[0] = 0;
      num[1] = 1;
    } else if (num[0] == 0 && num[1] == -1) {
      num[0] = 1;
      num[1] = 0;
    } else
      return 0;
  }
  for (int i = 0; i < (n - 2); i++) {
    if (num[i + 2] == -1) {
      num[i + 2] = 0;
      continue;
    }
    num[i + 2] = num[i + 1] + num[i];
    num[i + 2] = mod(num[i + 2]);
  }
  if (n == 1) {
    if (m == 1)
      cout << 0;
    else
      cout << 1;
    return 0;
  }
  n--;
  cout << num[n] << endl;
}
