#include <bits/stdc++.h>
using namespace std;
int search(int x) {
  if (x <= 2) return 1;
  return search(x - 2) + search(x - 1);
}
int main() {
  long long n = 0, m = 0, ans = 1;
  cin >> n >> m;
  bool* a = new bool[n + 2];
  for (int i = 0; i <= n; ++i) {
    a[i] = true;
  }
  a[n + 1] = false;
  int tmp;
  for (int i = 0; i < m; ++i) {
    cin >> tmp;
    a[tmp] = false;
  }
  tmp = 0;
  for (int i = 0; i <= n + 1; ++i) {
    if (a[i]) {
      ++tmp;
    } else {
      if (tmp == 0) {
        ans = 0;
        break;
      }
      ans *= search(tmp);
      tmp = 0;
    }
  }
  cout << ans % 1000000007;
  return 0;
}
