#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long int dansuu(int x) {
  long long int A[100010];
  A[0] = 1, A[1] = 1, A[2] = 2;
  if (x == 0 || x == 1)
    return 1;
  else if (x == 2)
    return 2;
  else {
    for (int i = 0; i < x - 1; i++) {
      A[i + 2] = A[i + 1] + A[i];
      A[i + 2] %= mod;
    }
    return A[x];
  }
}
int main() {
  long long int N, M, a = 0, b, res = 1;
  cin >> N >> M;
  if (M != 0) {
    cin >> b;
    res = dansuu(b - 1);
    a = b;
    for (int i = 1; i < M; i++) {
      cin >> b;
      res *= dansuu(b - a - 2);
      a = b;
    }
    cout << (res * dansuu(N - a - 1)) % mod << endl;
  } else
    cout << dansuu(N) % mod << endl;
  return 0;
}
