#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> v(M);
  vector<int> m(N);
  for (int i = 0, i_l = (M); i < i_l; i++) {
    cin >> v[i];
  }
  m[0] = 1;
  m[1] = 1;
  for (int i = 0, i_l = (N - 2); i < i_l; i++) {
    m[i + 2] = m[i + 1] + m[i];
    m[i + 2] %= 1000000007;
  }
  long long int sum = 1;
  int pre = 0;
  for (int i = 0, i_l = (M); i < i_l; i++) {
    int a = v[i] - pre - 1;
    if (a < 0) sum *= 0;
    sum *= m[a];
    sum %= 1000000007;
    pre = v[i] + 1;
  }
  sum *= m[max(N - pre, 1)];
  sum %= 1000000007;
  cout << sum;
  return 0;
}
