#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, s, t;
  cin >> N >> M;
  vector<int> a(M), fi(N);
  for (int i = 0; i < M; i++) cin >> a.at(i);
  fi.at(0) = 1;
  fi.at(1) = 1;
  fi.at(2) = 1;
  fi.at(3) = 2;
  fi.at(4) = 3;
  for (int i = 5; i < N; i++) fi.at(i) = fi.at(i - 1) + fi.at(i - 2);
  t = fi.at(a.at(0));
  for (int i = 1; i <= M - 1; i++) {
    s = a.at(i) - a.at(i - 1) - 1;
    if (s == 0) {
      cout << 0 << endl;
      return 0;
    } else
      t *= fi.at(s);
  }
  t *= fi.at(N - a.at(M - 1));
  cout << t % 1000000007 << endl;
}
