#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  long long int ans = 1;
  cin >> n >> m;
  vector<long> a(m + 2);
  vector<long> num(n + 3);
  a.at(0) = -1;
  a.at(m + 1) = n + 1;
  for (int i = 1; i < m + 1; ++i) cin >> a.at(i);
  num.at(0) = 0;
  num.at(1) = 0;
  num.at(2) = 1;
  for (int i = 3; i < n + 3; ++i) num.at(i) = num.at(i - 1) + num.at(i - 2);
  if (m == 0)
    ans = num.at(n + 2);
  else {
    for (int i = 1; i < m + 2; ++i) {
      int x = a.at(i) - a.at(i - 1);
      ans *= num.at(x);
      ans = ans % 1000000007;
    }
  }
  cout << ans << endl;
}
