#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A[100010];
  A[0] = 1;
  A[1] = 1;
  for (int i = 2; i <= 100000; i++) {
    A[i] = A[i - 1] + A[i - 2];
  }
  int N;
  int M;
  int a[100010];
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < M; i++) {
    if (a[i] - a[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  if (M == 0) {
    long long result = 1;
    result *= A[N];
    result %= 1000000007;
    cout << result << endl;
    return 0;
  }
  vector<int> list{};
  list.push_back(a[0] - 1 - 0);
  for (int i = 1; i < M; i++) {
    list.push_back(a[i] - a[i - 1] - 2);
  }
  list.push_back(N - a[M - 1] - 1);
  long long result = 1;
  for (int i = 0; i < list.size(); i++) {
    result *= A[list[i]];
    result %= 1000000007;
  }
  cout << result << endl;
  return 0;
}
