#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
void print(T t) {
  for (auto &it : t) cout << it << " ";
}
inline long long powerexp(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % m;
    a = a * a % m, b >>= 1;
  }
  return res % m;
}
const long long N = 1e5 + 1;
long long fib[N];
void pre() {
  fib[0] = 0, fib[1] = 1;
  for (long long i = 2; i <= N; i++) {
    fib[i] = fib[i - 1] % MOD + fib[i - 2] % MOD;
    fib[i] %= MOD;
  }
}
void solve() {
  pre();
  long long ans = 0;
  long long n, m;
  cin >> n >> m;
  bool visited[n + 1];
  for (long long i = 0; i < n; i++) visited[i] = false;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    x--;
    visited[x] = true;
  }
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (!visited[i]) {
      cnt++;
      if (cnt == 1)
        ans += fib[0];
      else
        ans += fib[cnt];
    } else {
      if (visited[i] and visited[i + 1]) {
        cout << 0;
        exit(0);
      } else if (visited[i]) {
        cnt = 0;
        ans++;
      }
    }
  }
  cout << (ans - 1) % MOD << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  solve();
}
