#include <bits/stdc++.h>
using namespace std;
int a[100050];
int b[100050];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    cin >> b[i];
  }
  int flag = 0;
  for (int i = 2; i <= k; i++) {
    if (b[i - 1] + 1 == b[i]) {
      flag = 1;
    }
  }
  if (flag == 1) {
    cout << '0' << endl;
  } else {
    int q = 1;
    if (b[q] == 1) {
      a[1] = 0;
      a[2] = 1;
      q++;
    } else if (b[q] == 2) {
      a[1] = 1;
      a[2] = 0;
      q++;
    } else {
      a[1] = 1;
      a[2] = 2;
    }
    for (int i = 3; i <= n; i++) {
      if (b[q] == i) {
        a[i] = 0;
        q++;
      } else {
        a[i] = a[i - 1] + a[i - 2];
        a[i] = a[i] % 1000000007;
      }
    }
    cout << a[n] << endl;
  }
  return 0;
}
