#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
long long bk[1000000], fr[1000000];
int32_t main() {
  fastio();
  long long n, m;
  cin >> n >> m;
  long long a[m];
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    bk[a[i]] = 1;
  }
  long long fg = 0;
  for (long long i = 1; i < n; i++) {
    if (a[i] == a[i - 1] + 1) fg = 1;
  }
  if (fg == 1) {
    cout << 0;
    return 0;
  }
  fr[0] = 1;
  for (long long i = 0; i <= n - 1; i++) {
    if (bk[i] == 1) continue;
    if (bk[i + 1] == 0) fr[i + 1] = (fr[i + 1] + fr[i]) % 1000000007;
    if (bk[i + 2] == 0) fr[i + 2] = (fr[i + 2] + fr[i]) % 1000000007;
  }
  cout << fr[n];
}
