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