#include <bits/stdc++.h>
using namespace std;
long long c(int n, vector<int> a) {
  int m = a.size();
  int f1 = 1;
  int f2 = 1;
  if (n == 1) {
    if (a[0] == 1)
      return 0;
    else
      return 1;
  }
  for (int i = 0; i < m; i++) {
    if (a[i] == n) return 0;
    if (a[i] == n - 1) f1 = 0;
    if (a[i] == n - 2) f2 = 0;
  }
  return f1 * c(n - 1, a) + f2 * c(n - 2, a);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> c(n + 1);
  c[0] = 1;
  if (a[0] == 1)
    c[1] = 0;
  else
    c[1] = 1;
  int bj = 0;
  for (int i = 2; i <= n; i++) {
    int f1 = 1;
    int f2 = 1;
    int flag = 0;
    for (int j = bj; j < m; j++) {
      if (a[j] >= i - 2 && flag == 0) {
        bj = j;
        flag = 1;
      }
      if (a[j] > i) {
        break;
      }
      if (a[j] == i) {
        f1 = 0;
        f2 = 0;
        break;
      }
      if (a[j] == i - 1) {
        f1 = 0;
      }
      if (a[j] == i - 2) {
        f2 = 0;
      }
    }
    c[i] = (f1 * c[i - 1] + f2 * c[i - 2]) % 1000000007;
  }
  cout << c[n] << endl;
  return 0;
}
