#include <bits/stdc++.h>
using namespace std;
int stepup(int n) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (n == 2) return 2;
  return stepup(n - 1) + stepup(n - 2);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      cout << "0\n";
      return 0;
    }
  }
  int num = 0;
  num += stepup(a[0] - 1);
  for (int i = 1; i < m; i++) {
    num += stepup(a[i] - 1 - (a[i - 1] + 1));
  }
  num += stepup(n - (a[m - 1] + 1));
  cout << num % 1000000007 << "\n";
  return 0;
}
