#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
long long dp[100010] = {0};
int main() {
  long long N, M;
  cin >> N >> M;
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i < N; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin >> A[i];
  long long ans = dp[A[0] - 1];
  int flag = 0;
  for (int i = 0; i < M - 1; i++) {
    if (A[i] + 1 == A[i + 1]) {
      flag = 1;
      break;
    } else {
      ans = ((ans % 1000000007) * (dp[A[i + 1] - 1 - A[i] - 1] % 1000000007)) %
            1000000007;
    }
  }
  ans = ((ans % 1000000007) * (dp[N - A[M - 1] - 1] % 1000000007)) % 1000000007;
  if (flag == 1) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
}
