#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;
int main(void) {
  ull mod = 1000000007;
  uint N, M;
  cin >> N >> M;
  queue<uint> aq;
  for (uint i = 0; i < M; i++) {
    uint a;
    cin >> a;
    if (!aq.empty() && (a - 2) == aq.back()) {
      cout << 0;
      return 0;
    } else {
      aq.push(a - 1);
    }
  }
  ull dp_2 = (aq.front() == 0) ? 0 : 1;
  ull dp_1 = (aq.front() == 0) ? 1 : (aq.front() == 1) ? 0 : 2;
  ull dp;
  for (uint i = 2; i < N; i++) {
    dp = 0;
    if (aq.front() == i - 1) {
      dp = dp_2;
    } else if (aq.front() == i - 2) {
      dp = dp_1;
      aq.pop();
    } else {
      dp = (dp_1 + dp_2) % mod;
    }
    dp_2 = dp_1;
    dp_1 = dp;
  }
  cout << dp;
  return 0;
}
