#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v[i];
  }
  vector<int> fib(n + 1);
  for (int j = 1; j <= n; j++) {
    if (j == 1) {
      fib[j] = 1;
    } else if (j == 2) {
      fib[j] = 2;
    } else {
      fib[j] = fib[j - 1] + fib[j - 2];
    }
  }
  vector<int> s(m + 1);
  s[0] = v[0] - 1;
  for (int k = 1; k < m; k++) {
    s[k] = v[k] - v[k - 1] - 2;
  }
  s[m] = v[m] - 1;
  int ans = 1;
  for (int l = 0; l < m + 1; l++) {
    ans *= fib[s[l]];
  }
  cout << ans % 1000000007 << endl;
}
