#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long n, m, k, i, a[100005], ans;
set<long long> st;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> k, st.insert(k);
  a[1] = 1;
  a[2] = 2;
  a[3] = 3;
  if (st.count(1)) a[1] = 0, a[2] = 1, a[3] = 1;
  if (st.count(2)) a[2] = 0, a[3] = 1;
  if (st.count(3)) a[3] = 0;
  for (i = 4; i <= 1e5; i++)
    if (!st.count(i)) a[i] = (a[i - 1] + a[i - 2]) % mod;
  cout << a[n];
  return 0;
}
