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