#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < (m); ++i) {
    cin >> v[i];
  }
  int ptr = 0;
  long long tmp2 = 1;
  long long tmp1 = 1;
  if (v[0] == 1) {
    tmp1 = 0;
    ptr++;
  }
  long long now;
  for (int i = (2); i <= (n); ++i) {
    if (ptr >= m) {
      now = tmp1 + tmp2;
      tmp2 = tmp1;
      tmp1 = now;
    } else if (v[ptr] == i) {
      now = 0;
      tmp2 = tmp1;
      tmp1 = now;
      ptr++;
    } else {
      now = tmp1 + tmp2;
      tmp2 = tmp1;
      tmp1 = now;
    }
    now %= 1000000007;
  }
  cout << (now) << endl;
  ;
  return 0;
}
