#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int main() {
  map<int, int> C;
  int N, M;
  cin >> N >> M;
  C[0] = 1;
  C[1] = 1;
  C[2] = 2;
  for (int i = 3; i < N; i++) {
    C[i] = (C[i - 1] + C[i - 2]) % mod;
  }
  int tmp;
  int zendan = 0;
  int ans = 1;
  for (int i = 0; i < M; i++) {
    cin >> tmp;
    if (zendan == tmp) {
      ans = 0;
      break;
    }
    int sa = tmp - zendan - 1;
    ans = ((long long)ans * C[sa]) % mod;
    zendan = tmp + 1;
  }
  int sa = N - zendan;
  ans = ((long long)ans * C[sa]) % mod;
  cout << ans << endl;
  return 0;
}
