#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int flag = 0;
  int a[M];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    if (i > 0) {
      if (a[i] - a[i - 1] == 1) {
        flag = 1;
      }
    }
  }
  if (flag == 1) {
    cout << 0 << endl;
  } else {
    if (N == 1 && M == 1) {
      cout << 0 << endl;
    } else if (N == 1 && M == 0) {
      cout << 1 << endl;
    } else if (N == 2 && M == 0) {
      cout << 2 << endl;
    } else if (N == 2 && M == 1) {
      cout << 1 << endl;
    } else if (N == 2 && M == 2) {
      cout << 0 << endl;
    } else {
      if (M > N / 2 + 1) {
        cout << 0 << endl;
      } else {
        long int n_1 = 1, n_2 = 2;
        long int n;
        if (M > 0 && a[0] == 1) {
          n_1 = 0;
          n_2 = 1;
          if (a[1] == 2) {
            n_2 = 0;
          }
        } else if (M > 0 && a[0] == 2) {
          n_2 = 0;
        }
        int k = 0;
        for (int i = 3; i <= N; i++) {
          n = (n_1 + n_2) % 1000000007;
          for (int j = k; j < M; j++) {
            if (a[j] == i) {
              n = 0;
              break;
            }
          }
          n_1 = n_2;
          n_2 = n;
        }
        cout << n << endl;
      }
    }
  }
}
