/*	AtCoder ARC 077 D 11
	1st Edition:2017.7.2 Sunday
	Algorithm:组合数学
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <cstdlib>
#include <ctime>
using namespace std;

#define For(a,b,c) for(int (a)=(b);(a)<=(c);a++)
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
const long double eps=1e-9;
const ll inf=1000000007LL;
const ll maxn=100005LL;
const ll mod=1000000007LL;

//input
int n;
int a[maxn];
int p,q,tar;
int cnt[maxn];

void input(){
	cin>>n;
	For(i,1,n){
		cin>>a[i];
		cnt[a[i]]++;
	}
}

//main
int main(){
	input();
	For(i,1,n)
		if(cnt[a[i]]>1){
			tar=a[i];
			break;
		}
	For(i,1,n)
		if(a[i]==tar){
			if(!p){
				p=i;
			}else{
				q=i;
				break;
			}
		}
	ll C1=n+1,C2=1;						//C1:C(n+1,k)    C2:C(n+p-q-1,k-1)
	cout<<n<<endl;
	For(i,2,n){
		C1=C1*(n+2-i)/i%mod;
		C2=C2*(n+p-q+2-i)/(i-1)%mod;
//		cout<<(C1-C2+mod)%mod<<endl;
		cout<<C1<<" "<<C2<<endl;
	}
	cout<<1<<endl;
	return 0;
}
