#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N, M;
  bool a[10005];
  for (int i = 0; i < 10005; ++i) {
    a[i] = true;
  }
  cin >> N >> M;
  int temp;
  for (int i = 0; i < M; ++i) {
    cin >> temp;
    a[temp] = false;
  }
  long long ans[10005];
  for (int i = 0; i <= N; ++i) {
    if (a[i] == false) {
      ans[i] = 0;
    } else if (i == 0) {
      ans[i] = 1;
    } else if (i == 1) {
      ans[i] = ans[i - 1];
    } else {
      ans[i] = ans[i - 1] + ans[i - 2];
      if (ans[i] > 1000000007) {
        ans[i] %= 1000000007;
      }
    }
  }
  cout << ans[N] << endl;
  return 0;
}
