#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[100010];
  int br[100010] = {0};
  for (int i = (0); i < (M); ++i) {
    cin >> a[i];
    br[a[i] - 1] = 1;
  }
  long long num[100010];
  if (br[0] == 1) {
    num[0] = 0;
  } else {
    num[0] = 1;
  }
  if (br[1] == 1) {
    num[1] = 0;
  } else {
    num[1] = 1 + num[0];
  }
  for (int i = (2); i < (N); ++i) {
    if (br[i] == 1) {
      num[i] = 0;
    } else {
      num[i] += num[i - 1] + num[i - 2];
    }
  }
  cout << num[N - 1] % 1000000007 << endl;
}
