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