#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> ans;
  long long a[m];
  for (int i = 0; i < (int)(m); ++i) {
    cin >> a[i];
  }
  ans.push_back(1);
  long long p = 0;
  for (int i = 0; i < (int)(n); ++i) {
    if (a[p] == i + 1) {
      p++;
      ans.push_back(0);
    } else {
      long long c1 = ans[i];
      long long c2 = ans[i - 1];
      long long c = c1 + c2;
      ans.push_back(c % 1000000007);
    }
  }
  cout << ans[ans.size() - 1] << endl;
}
