#include <bits/stdc++.h>
using namespace std;
long long a[100000];
long long able[100000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    able[a[i]] = 1;
  }
  for (int i = 0; i < m - 1; i++) {
    if (a[i] != 0 && a[i] == a[i + 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long t1 = 1, t2 = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (able[i] == 1) {
      ans = 0;
    } else {
      ans = t1 + t2;
    }
    t2 = t1;
    t1 = ans;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
