#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (size_t i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> a2(m);
  for (size_t i = 0; i < m; i++) {
    if (i == 0) {
      a2[i] = a[i];
    } else {
      a2[i] = a[i] - a[i - 1] - 1;
    }
  }
  if (m == 0) {
    a2.push_back(n + 1);
  } else {
    a2.push_back(n - a[m - 1]);
  }
  vector<long> step12(n);
  step12[0] = 1;
  step12[1] = 1;
  step12[2] = 2;
  for (size_t i = 3; i < n; i++) {
    step12[i] = (step12[i - 1] + step12[i - 2]) % 1000000007;
  }
  long ans = 1;
  for (size_t i = 0; i < m + 1; i++) {
    if (a2[i] == 0) {
      cout << 0;
      return 0;
    }
    ans *= step12[a2[i] - 1];
    ans %= 1000000007;
  }
  cout << ans;
}
