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