#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> v(n + 1, 0);
  v[0] = 1;
  v[1] = 1;
  v[2] = 2;
  for (int i = 3; i <= n; i++) {
    v[i] = v[i - 1] + v[i - 2];
  }
  long long count = 1;
  long long last = 0;
  for (int i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    count =
        ((count % 1000000007) * (v[tmp - last - 1] % 1000000007)) % 1000000007;
    last = tmp + 1;
  }
  count = ((count % 1000000007) * (v[n - last] % 1000000007)) % 1000000007;
  cout << count;
  return 0;
}
