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