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