#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int a[111111];
  int i;
  cin >> N >> M;
  int x = 0;
  for (i = 0; i <= M - 1; i++) cin >> a[i];
  for (i = 1; i <= M - 1; i++)
    if (a[i] == a[i - 1] + 1) {
      cout << 0 << endl;
      x = 1;
    }
  int num[111111];
  num[0] = 1;
  num[1] = 1;
  int count = 0;
  if (x == 0) {
    for (i = 1; i <= N; i++) {
      if (i == a[count]) {
        num[i] = num[i - 1];
        i++;
        num[i] = num[i - 1];
        i++;
        num[i] = num[i - 1];
        count++;
      }
      if (i != a[count]) num[i + 1] = (num[i] + num[i - 1]) % 1000000007;
    }
    cout << num[N] << endl;
  }
}
