#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
ll N, M;
vector<ll> a;
ll dfs(ll n, ll i) {
  if (n == N) return 1;
  if (a[i] == n || a[i + 1] == n || n > N) return 0;
  while (a[i] < n && i < M) i++;
  return (dfs(n + 1, i) + dfs(n + 2, i)) % mod;
}
int main() {
  cin >> N >> M;
  a = vector<ll>(M);
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
  }
  cout << dfs(0, 0) << endl;
}
