#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a;
  int box;
  int sum = 0;
  int pre_1 = 1;
  int pre_2 = 1;
  int cnt = 0;
  int i;
  for (i = 0; i < m; i++) {
    cin >> box;
    a.push_back(box);
  }
  for (i = 0; i <= n; i++) {
    if (i == 0 || i == 1) {
      if (a[cnt] == i) {
        sum = 1;
        pre_1 = 0;
        if (cnt < m) cnt++;
      } else {
        sum = 1;
        pre_1 = 1;
      }
    } else {
      if (a[cnt] == i) {
        if (pre_1 == 0) {
          sum = 0;
          break;
        }
        pre_2 = pre_1;
        pre_1 = 0;
        if (cnt < m) cnt++;
      } else {
        sum = (pre_1 + pre_2) % 1000000007;
        pre_2 = pre_1;
        pre_1 = sum;
      }
    }
  }
  cout << sum << endl;
}
