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