#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 memo = 1;
long long DP(long long a) {
  stair[0] = memo;
  stair[1] = memo;
  if (a <= 1) {
    return memo;
  } else {
    return stair[a] = DP(a - 1) + DP(a - 2);
  }
}
string S;
int main() {
  long long a = 0, b = 0;
  cin >> a >> b;
  long long yeah[100009] = {0};
  long long c = 0, d = 0;
  if (b == 0) {
    cout << DP(a) << endl;
    return 0;
  } else {
    for (int i = 0; i < b; i++) {
      cin >> yeah[i];
    }
    sort(yeah, yeah + b);
    for (int i = 0; i < b; i++) {
      if (yeah[i] + 1 == yeah[i + 1]) {
        cout << '0' << endl;
        return 0;
      } else {
        if (i == 0) {
          memo = DP(yeah[i] - 1 - c) % 1000000007;
        } else {
          memo = DP(yeah[i] - 1 - c) % 1000000007;
        }
        c = yeah[i] + 1;
      }
    }
    cout << DP(a - c) % 1000000007 << endl;
    return 0;
  }
  return 0;
}
