#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> juice;
int gcd(int a, int b) {
  while (a % b != 0) {
    int c = 0;
    c = a % b;
    a = b;
    b = c;
  }
  return b;
}
long long stair[100009];
long long outo[100009];
long long memo = 1;
string S;
int main() {
  long long a = 0, b = 0;
  cin >> a >> b;
  for (int i = 0; i < b; i++) {
    cin >> outo[i];
    stair[outo[i]] = 1000000009;
    ;
    stair[outo[i] + 1] = 1000000009;
    ;
    stair[outo[i] + 2] = 1000000009;
    ;
    if (i != 0) {
      if (outo[i] - 1 == outo[i - 1]) {
        cout << '0' << endl;
      }
    }
  }
  stair[0] = 1;
  stair[1] = 1;
  for (int i = 1; i <= a; i++) {
    if (stair[i] == 1000000009) {
      stair[i] = stair[i - 1];
    } else {
      stair[i] = (stair[i - 1] + stair[i - 2]) % 1000000007;
    }
  }
  cout << stair[a] << endl;
  return 0;
}
