#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll n, m, a[100001] = {0};
  ll p[100001] = {0};
  cin >> n >> m;
  for (ll i(0); i < m; i++) {
    ll ai;
    cin >> ai;
    a[ai] = 1;
  }
  if (n == 1) {
    cout << 1;
    return 0;
  } else if (n == 2) {
    ll ans = (a[1] == 1) ? 1 : 2;
    cout << ans;
    return 0;
  }
  if (a[1] == 1 && a[2] == 1) {
    cout << 0;
    return 0;
  } else if (a[1] == 1) {
    p[2] = 1;
  } else if (a[2] == 1) {
    p[1] = 1;
  } else {
    p[1] = 1;
    p[2] = 2;
  }
  for (ll i(3); i <= n; i++) {
    if (a[i] != 1) {
      if (a[i - 1] == 1 && a[i - 2] == 1) {
        cout << 0;
        return 0;
      } else {
        p[i] = p[i - 1] + p[i - 2];
      }
    }
  }
  cout << p[n] % 1000000007;
}
