#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m;
int sum;
const ll inf = 1000000007;
ll ans = 1;
ll fib(int k) {
  if (k >= 0 && k <= 1)
    return 1;
  else if (k == 2)
    return 2;
  else if (k >= 3)
    return fib(k - 1) + fib(k - 2);
  else
    return 0;
}
int main() {
  cin >> n >> m;
  if (m != 0) {
    vector<int> a(m);
    for (int i = 0; i < (int)(m); i++) {
      cin >> a.at(i);
    }
    int step = 0;
    for (int i = 0; i < (int)(m); i++) {
      int k = a.at(i) - step - 1;
      if (k < 0) {
        ans = 0;
        break;
      } else if (k == 0) {
        step += a.at(i) + 1;
      } else {
        step = a.at(i) + 1;
        ans *= fib(k);
      }
    }
    ans *= fib(n - step);
  } else
    ans = fib(n);
  cout << ans % inf << endl;
}
