#include <bits/stdc++.h>
using namespace std;
void dfs(long long x, long long size, long long *cnt) {
  if (x == size) {
    *cnt = *cnt + 1;
    return;
  }
  if (x <= size - 2) {
    dfs(x + 2, size, cnt);
  }
  if (x < size) {
    dfs(x + 1, size, cnt);
  }
}
int main() {
  long long ans = 1;
  long long cnt = 0;
  long long N = 0;
  long long M = 0;
  long long mns1 = 0;
  long long mns2 = 0;
  long long tmp = 0;
  long long now = 0;
  long long acnt = 0;
  cin >> N >> M;
  vector<long long> a(M), b(M + 1);
  for (long long i = 0; i < M; i++) {
    cin >> a[i];
    if ((a[i - 1] + 1) == a[i]) {
      cout << "0" << endl;
      return 0;
    }
  }
  mns2 = 1;
  mns1 = 1;
  if (a[acnt] == 1) {
    mns1 = 0;
    acnt++;
  }
  for (long long i = 2; i < N + 1; i++) {
    if (i == a[acnt] + 1) {
      now = mns2;
      mns2 = 0;
      mns1 = now;
      acnt++;
    } else if (i == a[acnt]) {
      now = 0;
      mns2 = mns1;
      mns1 = 0;
    } else {
      now = mns1 + mns2;
      mns2 = mns1;
      mns1 = now;
    }
    if (now > 1000000007) {
      now = now - 1000000007;
    }
    if (mns1 > 1000000007) {
      mns1 = mns1 - 1000000007;
    }
    if (mns2 > 1000000007) {
      mns2 = mns2 - 1000000007;
    }
  }
  cout << now % 1000000007 << endl;
}
