#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, b[10001], s[10001], now = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < m; i++) {
    if (b[i] + 1 == b[i + 1]) {
      cout << "0" << endl;
      return 0;
    }
  }
  s[0] = 1;
  if (b[now] == 1) {
    s[1] = 0;
    now++;
  } else {
    s[1] = 1;
  }
  if (b[now] == 2) {
    s[2] = 0;
    now++;
  } else {
    s[2] = s[1] + 1;
  }
  for (int i = 3; i <= n; i++) {
    if (i == b[now]) {
      now++;
      s[i] = 0;
      continue;
    }
    s[i] = (s[i - 1] + s[i - 2]) % 1000000007;
    if (s[i] / 1000000007 && s[i - 1] / 1000000007) {
      s[i] %= 1000000007;
      s[i - 1] %= 1000000007;
    }
  }
  cout << s[n] % 1000000007 << endl;
  return 0;
}
