#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  long long ans = 1;
  cin >> N >> M;
  int pos = -1;
  vector<int> fibo(N + 10);
  fibo[1] = 1;
  fibo[2] = 1;
  int mod = 1e9;
  for (int i = 3; i <= N; i++) {
    fibo[i] = fibo[i - 1] + fibo[i - 2];
  }
  for (int i = 0; i < M; i++) {
    int j;
    cin >> j;
    if (j - 1 == pos) {
      cout << 0 << endl;
      return 0;
    }
    ans = (ans * fibo[j - pos - 1]) % (mod + 7);
    pos = j;
  }
  ans = (ans * fibo[N - pos]) % (mod + 7);
  cout << ans << '\n';
}
