#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(m + 2);
  vector<long long int> num(n + 5);
  a[0] = -1;
  a[m + 1] = n + 1;
  for (long long int i = 1; i < m + 1; ++i) cin >> a[i];
  num[0] = 0;
  num[1] = 1;
  for (long long int i = 2; i < n + 5; ++i) num[i] = num[i - 1] + num[i - 2];
  long long int ans = 1;
  for (long long int i = 0; i < m + 1; ++i) {
    long long int k = a[i + 1] - a[i] - 1;
    ans *= num[k];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
