#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;
  }
  int c[n + 1];
  c[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (!b[i]) continue;
    if (i + 2 > n && b[i])
      c[i] = 1;
    else {
      if (b[i] && b[i + 1] && b[i + 2])
        c[i] = c[i + 1] % 1000000007 + c[i + 2] % 1000000007;
      else if (b[i] && b[i + 1] && !b[i + 2])
        c[i] = c[i + 1] % 1000000007;
      else if (b[i] && !b[i + 1] && b[i + 2])
        c[i] = c[i + 2] % 1000000007;
      else {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << c[0] << endl;
}
