#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for (decay_t <decltype (n)> i = 0, i ## __len = (n); i < i ## __len; ++ i)

constexpr auto MOD = static_cast <int64_t> (1e+9+7);

auto main () -> int
{
  cin.tie (nullptr);
  ios::sync_with_stdio (false);

  size_t n, m;
  cin >> n >> m;

  vector <int> a (n + 1, 0);

  rep (i, m)
  {
    size_t a_;
    cin >> a_;
    a [a_] = 1;
  }
  vector <int64_t> ans (n + 1, 0);

  ans [0] = 1;
  rep (i, n)
  {
    if (a [i + 1] != 1)
    {
      ans [i + 1] += ans [i];
      ans [i + 1] %= MOD;
    }

    if (a [i + 2] != 1)
    {
      ans [i + 2] += ans [i];
      ans [i + 2] %= MOD;
    }
  }

  cout << ans [n] << endl;
}

