#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}
vector<int> mem(100000, -1);
int temp;
int count(queue<int>& ng, int current, int n) {
  if (!ng.empty() && ng.front() == current) {
    mem[current] = 0;
    return 0;
  } else if (mem[current] != -1)
    return mem[current];
  else if (current == n || current == n - 1) {
    mem[current] = 1;
    return 1;
  } else if (!ng.empty() && ng.front() == current + 1) {
    ng.pop();
    temp = count(ng, current + 2, n);
    mem[current + 1] = 0;
    mem[current] = temp;
    return temp;
  } else if (!ng.empty() && ng.front() == current + 2) {
    ng.pop();
    temp = count(ng, current + 3, n);
    mem[current + 2] = 0;
    mem[current + 1] = temp;
    mem[current] = temp;
    return temp;
  } else {
    temp =
        mod(count(ng, current + 1, n) + count(ng, current + 2, n), 1000000007);
    mem[current] = temp;
    return temp;
  }
}
int main() {
  int(n);
  cin >> n;
  int(m);
  cin >> m;
  queue<int> ng;
  for (int i = (0); i < (m); ++i) {
    int(a);
    cin >> a;
    if (!ng.empty() && a == ng.front() + 1) {
      cout << 0 << endl;
      return 0;
    }
    ng.push(a);
  }
  cout << count(ng, 0, n) << endl;
}
