#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, br;
  cin >> n >> br;
  int f = 1;
  vector<bool> step(n + 1, false);
  vector<int> b(br);
  for (int i = 0; i < br; i++) {
    cin >> b[i];
    step[b[i]] = true;
    if (i >= 1 && b[i] - b[i - 1] == 1) {
      f = 0;
      break;
    }
  }
  vector<int> a(n + 1);
  a[0] = 1;
  a[1] = (step[1] ? 0 : 1);
  for (int i = 2; i < n; i++) {
    if (step[i]) {
      a[i] = 0;
    } else {
      a[i] = a[i - 1] % 1000000007 + 2 * a[i - 2] % 1000000007;
    }
  }
  if (f) {
    cout << a[n] % 1000000007;
  } else {
    cout << 0;
  }
}
