#include <bits/stdc++.h>
using namespace std;
int main() {
  int j = 0;
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> b(n);
  vector<long long> ans(n);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    if (j < m && i == a[j]) {
      b[i - 1] = 1;
      j++;
    } else {
      b[i - 1] = 0;
    }
  }
  if (a[0] == 1)
    ans[0] = 0;
  else
    ans[0] = 1;
  if (n >= 2) {
    if (a[0] == 1 && a[1] == 2)
      ans[1] = 0;
    else if (a[0] == 1 || a[0] == 2)
      ans[1] = 1;
    else
      ans[1] = 2;
  }
  if (n >= 3) {
    for (int i = 3; i <= n; i++) {
      if (b[i - 1] == 1)
        ans[i - 1] = 0;
      else {
        if (b[i - 2] != 1) ans[i - 1] += ans[i - 2];
        if (b[i - 3] != 1) ans[i - 1] += ans[i - 3];
        ans[i - 1] %= 1000000007;
      }
    }
  }
  cout << ans[n - 1] << endl;
  return 0;
}
