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