#include<bits/stdc++.h>
//ULVILAMAFIA&O(n^10)
typedef long long ll;
using namespace std;
ll taikaluku(ll n, ll m) {
ll g[n][m];
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
ll sum = 0;
if(i > 0) sum += g[i-1][j];
if(j > 0) sum += g[i][j-1];
if(sum == 0) { g[i][j] = 1; }
else { g[i][j] = sum; }
}
}
return g[n-1][m-1];
}
int main() {
//cout << "DEBUG: " << taikaluku(2,1) << "\n";
ll m = 1e9+7;
int n; cin >> n;
ll ss[n][n];
for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> ss[i][j];
ll je[n][n];
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
je[i][j] = taikaluku(i+1, j+1) * taikaluku(n-i, n-j);
}
}
//cout << "FUCK\n";
ll sum = 0;
//cout << "VAMMAFLAG" << "\n";
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
sum = (sum+(je[i][j]*ss[i][j])%m)%m;
}
}
if(sum < 0) sum += m;
cout << sum << "\n";
}