#include <bits/stdc++.h>
using namespace std;
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(3);
  c[1] = 1;
  if (a[0] == 1)
    c[2] = 0;
  else
    c[2] = 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[0] = c[1];
    c[1] = c[2];
    c[2] = (f1 * c[0] + f2 * c[1]) % 1000000007;
  }
  cout << c[2] << endl;
  return 0;
}
