#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, p, pp, c, t;
  long long mod = 1e9 + 7;
  cin >> n >> m;
  vector<long long> a(n + 1, 0);
  for (long long i = 0; i < m; i++) {
    cin >> t;
    a[t] = 1;
  }
  if (n == 1)
    cout << 1 << endl;
  else if (n == 2 && m == 0)
    cout << 2 << endl;
  else if (n == 2)
    cout << 1 << endl;
  else {
    pp = 1;
    p = 1;
    for (long long i = 0; i < n - 1; i++) {
      if (a[i] == 1 && a[i + 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
      if (a[i + 2] == 1) {
        pp = p;
      } else if (a[i] == 1) {
        c = p;
        pp = p;
        p = c;
      } else if (a[i + 1] == 1) {
        c = pp;
        pp = p;
        p = c;
      } else {
        c = pp + p;
        pp = p;
        p = c;
      }
    }
    cout << c % mod << endl;
  }
}
