#include <bits/stdc++.h>
using namespace std;
int f(int n) {
  if (n == 1 || n == 2) {
    return 1;
  } else {
    return f(n - 1) + f(n - 2);
  }
}
int main() {
  int N;
  int M;
  cin >> N >> M;
  int a[M];
  int ans = 1;
  int flag = 0;
  int b[M + 1];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < M - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      flag = 1;
      break;
    }
  }
  b[0] = a[0];
  for (int i = 1; i < M; i++) {
    b[i] = a[i] - a[i - 1] - 1;
  }
  b[M] = N - a[M - 1];
  if (flag == 1) {
    cout << 0;
  } else {
    for (int i = 0; i <= M; i++) {
      ans *= f(b[i]);
    }
    cout << ans % 1000000007;
  }
  cout << endl;
  return 0;
}
