#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 1);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  a.at(M) = N + 1;
  vector<long long> F(N + 1);
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      F.at(i) = 0;
    } else if (i == 1 || i == 2) {
      F.at(i) = 1;
    } else {
      F.at(i) = F.at(i - 1) + F.at(i - 2);
    }
  }
  long long ans = 1, left = 0, right = a.at(0), dist, cnt;
  dist = right - left;
  cnt = F.at(dist);
  ans *= cnt;
  ans %= 1000000007;
  ;
  for (int i = 0; i < M; i++) {
    left = right + 1;
    right = a.at(i + 1);
    dist = right - left;
    cnt = F.at(dist);
    ans *= cnt;
    ans %= 1000000007;
    ;
  }
  cout << ans << endl;
  return 0;
}
