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