#include <bits/stdc++.h>
using namespace std;
long int my_dfs(long int sum, int thresh) {
  if (thresh == 0) {
    return 0;
  }
  if (sum == thresh) {
    return 1;
  }
  if (sum > thresh) {
    return 0;
  }
  return (my_dfs(sum + 1, thresh) + my_dfs(sum + 2, thresh)) % 1000000007;
}
int main() {
  int i, n, m, amari;
  long int out = 1;
  int bet;
  vector<long int> A(m + 1);
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> A[i];
  }
  A[m] = n;
  for (i = 0; i <= m; ++i) {
    if (i == 0) {
      bet = A[i] - 1;
      if (A[i] == 1) {
        bet = 1;
      }
    } else if (i == m) {
      bet = A[m] - (A[i - 1] + 1);
    } else {
      bet = A[i] - 1 - (A[i - 1] + 1);
    }
    out *= my_dfs(0L, bet);
    out %= 1000000007;
  }
  cout << out << endl;
  return 0;
}
