#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int fib[100010] = {};
  fib[0] = 0, fib[1] = 1;
  for (int i = 2; i < 100000; i++) {
    fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000007;
  }
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << fib[n + 1] << "\n";
    return 0;
  }
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long int> v;
  int temp = 0;
  v.push_back(fib[a[0]]);
  for (int i = 1; i < m; i++) {
    v.push_back(fib[a[i] - a[i - 1] - 1]);
  }
  v.push_back(fib[n - a[m - 1]]);
  long long int ans = 1;
  for (int i = 0; i < v.size(); i++) {
    ans *= v[i];
    ans = ans % 1000000007;
  }
  cout << ans % 1000000007 << "\n";
  return 0;
}
