#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> ans;
  int 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 {
      if ((i + 1) % 2 != 0) {
        long long p = ans[i];
        ans.push_back(ans[i]);
      } else {
        long long p = ans[i];
        long long p1 = ans[i - 1];
        ans.push_back(p + p1);
      }
    }
  }
  cout << ans[ans.size() - 1] % 1000000007 << endl;
}
