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