#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int fib(int x) {
  int i = 1, ans = 1, a = 1, b = 1;
  cout << "x:" << x << endl;
  if (x == -1)
    ans = 0;
  else if (x && x != 1)
    while (i < x) {
      ans = (a + b) % MOD;
      a = b;
      b = ans;
      i++;
    }
  return ans;
}
int main() {
  int n, m, ans = 1;
  cin >> n >> m;
  vector<int> x(m + 2, 0);
  x.at(0) = -1;
  x.at(m + 1) = n + 1;
  for (int i = 1; i < m + 1; i++) cin >> x.at(i);
  for (int i = 0; i < m + 1; i++) {
    int num = fib(x.at(i + 1) - x.at(i) - 2);
    ans = (int)(((long long)ans * (long long)num) % MOD);
  }
  cout << ans;
}
