#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M + 2);
  a[0] = 0;
  for (int i = 1; i < M + 1; i++) {
    cin >> a[i];
  }
  a[M + 1] = N;
  vector<long long> deg(M + 1);
  for (int i = 0; i < M + 1; i++) {
    if (i == 0) {
      if (a[1] == 1) {
        deg[i] = 1;
      } else {
        deg[i] = a[1] - 1;
      }
    } else if (i == M) {
      if (a[M] == N - 1) {
        deg[i] = 1;
      } else {
        deg[i] = a[M + 1] - a[M] - 1;
      }
    } else {
      if (a[i + 1] - a[i] == 1) {
        deg[i] = 0;
      } else {
        deg[i] = a[i + 1] - a[i] - 2;
      }
    }
  }
  vector<long long> C(100005);
  C[0] = 0, C[1] = 1, C[2] = 2;
  for (int i = 3; i < 100005; i++) {
    C[i] = C[i - 1] + C[i - 2];
  }
  long long ans = 1;
  for (int i = 0; i < M + 1; i++) {
    ans = ans * C[deg[i]];
    ans = ans % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
