#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  long long mod = 1e9 + 7;
  int n, m;
  cin >> n >> m;
  vector<bool> stair(n + 1, true);
  for (int i = (int)(0); i < (int)(m); i++) {
    int a;
    cin >> a;
    stair[a] = false;
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  for (int i = (int)(0); i < (int)(n); i++) {
    for (int j = i + 1; j <= min(n, i + 2); j++) {
      if (stair[j] == true) {
        cout << j << " ";
        dp[j] += dp[i];
        dp[j] %= mod;
      }
      cout << dp[j] << endl;
    }
    cout << "a" << endl;
  }
  cout << dp[n] << endl;
  return 0;
}
