#include<bits/stdc++.h>
//ULVILAMAFIA&O(n^10)
typedef long long ll;
using namespace std;
ll mestari = 1e9+7;
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;
bool fuck = false;
if(i > 0) { sum += g[i-1][j]; fuck = true; }
if(j > 0) { sum += g[i][j-1]; fuck = true; }
if(i == 0 || j == 0) { g[i][j] = 1; }
else { g[i][j] = sum; }
g[i][j] %= mestari;
}
}
return g[n-1][m-1];
}
int main() {
//cout << "DEBUG: " << taikaluku(2,1) << "\n";
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);
je[i][j] %= mestari;
}
}
//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]))%mestari;
}
}
if(sum < 0) sum += mestari;
cout << sum << "\n";
}