#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 1);
  a[m] = n;
  vector<long long> st(n + 1, 0);
  st[0] = 1;
  for (int i = 0; i < m; ++i) cin >> a[i];
  int tmp = 0;
  for (int i = 0; i <= m; ++i) {
    for (; tmp < a[i]; ++tmp) {
      if (find(a.begin(), a.end(), tmp + 1) == a.end() && tmp + 1 <= n)
        st[tmp + 1] += st[tmp];
      if (find(a.begin(), a.end(), tmp + 2) == a.end() && tmp + 2 <= n)
        st[tmp + 2] += st[tmp];
    }
  }
  cout << (st[n - 1] + st[n - 2]) % 1000000007 << endl;
  return 0;
}
