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