#include <bits/stdc++.h>
using namespace std;
long long upstairs(int n) {
  long long S[n];
  S[0] = 1;
  if (n > 0) {
    S[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    S[i] = S[i - 1] + S[i - 2];
  }
  return S[n];
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> H(M);
  for (int i = 0; i < M; i++) {
    cin >> H[i];
  }
  H.push_back(N + 1);
  long long ans = 1;
  for (int i = 0; i < M; i++) {
    if (i == 0) {
      long long keep = upstairs(H[i] - 1);
      ans *= keep % 1000000007;
      ans %= 1000000007;
    } else {
      long long keep =
          (H[i] - H[i - 1] > 1 ? upstairs(H[i] - H[i - 1] - 2) : 0);
      ans *= keep % 1000000007;
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
