matrix_2x2[2] + result_matrix_2x2[3];
}


int main() {
  int n, m;
  long long int answer = 1;
  cin >> n >> m;
  int bef = -1;
  for (int i = 0; i < m; ++i) {
    int cur;
    cin >> cur;
    int time = cur - bef;
    bef = cur;
    if (time == 1) {
      cout << 0 << endl;
      return 0;
    }
    answer *= calculate_fibonacci(time-2);
    answer %= 1000000007;
  }
  int time = n - bef+1;
  answer *= calculate_fibonacci(time-2);
  answer %= 1000000007;
  cout << answer << endl;
}
