#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < M; i++) {
    if (a[i - 1] + 1 == a[i]) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long c, cb1 = 1, cb2 = 1;
  long long p1 = 0, p2 = 0;
  long long n = 1000000007;
  for (int i = 2; i < N + 1; i++) {
    if (i - 1 == a[p1]) {
      c = cb2 % n;
      p1++;
    } else if (i - 2 == a[p2]) {
      c = cb1 % n;
      p2++;
    } else {
      c = (cb1 + cb2) % n;
    }
    cb2 = cb1;
    cb1 = c;
  }
  cout << c << endl;
}
