#include <bits/stdc++.h>
using namespace std;
bool ch[100010];
long long ans[100010];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < k; i++) {
    long long x;
    cin >> x;
    ch[x] = true;
  }
  ans[0] = 1;
  for (long long i = 0; i <= n; i++) {
    ans[i + 2] += ans[i];
    ans[i + 1] += ans[i];
    if (ch[i + 2] == true) {
      ans[i + 2] = 0;
    }
    if (ch[i + 1] == true) {
      ans[i + 1] = 0;
    }
    ans[i + 2] %= 1000000007;
    ans[i + 1] %= 1000000007;
  }
  cout << ans[6];
  return 0;
}
