#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  long long ans = 1;
  cin >> n >> m;
  int a[m], F[m + 1];
  F[0] = 1;
  F[1] = 1;
  for (int i = 2; i < n; i++) {
    F[i] = F[i - 1] + F[i - 2];
  }
  cin >> a[0];
  for (int i = 1; i < m; i++) {
    std::cin >> a[i];
    if (a[i] == a[i - 1] + 1) {
      std::cout << 0 << std::endl;
      return 0;
    }
  }
  ans = F[a[0] - 1];
  for (int i = 1; i < m; i++) {
    int k = a[i] - a[i - 1] - 2;
    ans = (ans * F[k]) % 1000000007;
  }
  std::cout << (ans * F[n - a[m - 1] - 1]) % 1000000007 << std::endl;
}
