#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n , i , j , c= 0;
	cin >> n;
	char a[n][n];
	for(i = 0 ; i < n;i++)
	{
		for(j = 0;j < n;j++)
		{
			cin >> a[i][j];
			if(a[i][j] == '#')
				c++;
		}
	}
	if(c % 5 == 0)
		cout << "YES" << "\n";
	else
		cout << "NO" << "\n";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define sll set<ll>
#define str string
#define rev reverse
#define mp make_pair
#define pb push_back
#define acc accumulate
#define vll vector<ll>
#define eb emplace_back
#define pll pair<ll,ll>
#define vpll vector<pair<ll,ll> >
int main()
{
	ll n,i,j;
	cin >> n;
	ll a[n][n];
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			cin >> a[i][j];
		}
	}
	for(i=0;i<n-2;i++)
	{
		for(j=1;j<n-1;j++)
		{
			if(a[i][j]=='#' && a[i+1][j]=='#' && a[i+1][j+1]=='#' && a[i+1][j-1]=='#' && a[i+2][j]=='#')
			{
				a[i][j]=='.'; a[i+1][j]=='.'; a[i+1][j+1]=='.'; a[i+1][j-1]=='.'; a[i+2][j]=='.';

			}
		}
	}

	for(i=0;9<n;i++)
	{
		for(j=0;j<n;j++)
		{
			if(a[i][j]=='#')
			{
				cout << "NO";
				return 0;
			}
		}
	}
	cout << "YES";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define sll set<ll>
#define str string
#define rev reverse
#define mp make_pair
#define pb push_back
#define acc accumulate
#define vll vector<ll>
#define eb emplace_back
#define pll pair<ll,ll>
#define vpll vector<pair<ll,ll> >
int main()
{
	ll n,i,j;
	cin >> n;
	char a[n][n];
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			cin >> a[i][j];
		}
	}
	for(i=0;i<n-2;i++)
	{
		for(j=1;j<n-1;j++)
		{
			if(a[i][j]=='#' && a[i+1][j]=='#' && a[i+1][j+1]=='#' && a[i+1][j-1]=='#' && a[i+2][j]=='#')
			{
				a[i][j]='.';
				a[i+1][j]='.';
				a[i+1][j+1]='.';
				a[i+1][j-1]='.';
				a[i+2][j]='.';

			}
		}
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			if(a[i][j]=='#')
			{
				cout << "NO";
				return 0;
			}
		}
	}
	cout << "YES";
}


#include<bits/stdc++.h>
#define int long long int
#define SHUKRIYAA ios_base::sync_with_stdio(false);  cin.tie(NULL);  cout.tie(NULL);
using namespace std;
void inputOutput()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}

bool isprime(int n)
{
	if(n==1)
		return false;
	if(n==2||n==3)
		return true;
	for(int i=2;i<sqrt(n)+1;i++)
		if(n%i==0)
			return false;
	return true;
}

signed main()
{
	SHUKRIYAA ;
	inputOutput();

	int n;
	cin>>n;
	int arr[n][n];
	bool visited[n][n];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			char c;
			cin>>c;
			if(c=='#')
				arr[i][j]=1;
			else
				arr[i][j]=0;
			visited[i][j] = false;
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(arr[i][j] and visited[i][j]==false)
			{
				visited[i][j]=true;
				if(i>n-3||j==n-1||j==0)
					return cout<<"NO", 0;
				if(arr[i+1][j+1] and arr[i+1][j-1] and arr[i+1][j] and arr[i+2][j])
					visited[i+1][j+1] = visited[i+1][j-1] = visited[i+1][j] = visited[i+2][j] = true;
				else
					return cout<<"NO", 0;
			}
		}
	}
	cout<<"YES";

	cerr << "time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


#include<bits/stdc++.h>
#define int long long int
#define SHUKRIYAA ios_base::sync_with_stdio(false);  cin.tie(NULL);  cout.tie(NULL);
using namespace std;
void inputOutput()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}

bool isprime(int n)
{
	if(n==1)
		return false;
	if(n==2||n==3)
		return true;
	for(int i=2;i<sqrt(n)+1;i++)
		if(n%i==0)
			return false;
	return true;
}

signed main()
{
	SHUKRIYAA ;
	inputOutput();

	int n;
	cin>>n;
	int arr[n][n];
	bool visited[n][n];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			char c;
			cin>>c;
			if(c=='#')
				arr[i][j]=1;
			else
				arr[i][j]=0;
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(arr[i][j] and !visited[i][j])
			{
				visited[i][j]=true;
				if(i>n-3||j==n-1||j==0)
					return cout<<"NO", 0;
				if(arr[i+1][j+1] and arr[i+1][j-1] and arr[i+1][j] and arr[i+2][j])
					visited[i+1][j+1] = visited[i+1][j-1] = visited[i+1][j] = visited[i+2][j] = true;
				else
					return cout<<"NO", 0;
			}
		}
	}
	cout<<"YES";

	cerr << "time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


#include<bits/stdc++.h>
#define int long long int
#define SHUKRIYAA ios_base::sync_with_stdio(false);  cin.tie(NULL);  cout.tie(NULL);
using namespace std;
void inputOutput()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}

bool isprime(int n)
{
	if(n==1)
		return false;
	if(n==2||n==3)
		return true;
	for(int i=2;i<sqrt(n)+1;i++)
		if(n%i==0)
			return false;
	return true;
}

signed main()
{
	SHUKRIYAA ;
	inputOutput();

	int n;
	cin>>n;
	int arr[n][n];
	bool visited[n][n];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			char c;
			cin>>c;
			if(c=='#')
				arr[i][j]=1;
			else
				arr[i][j]=0;
			visited[i][j] = false;
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(arr[i][j] and visited[i][j]==false)
			{
				visited[i][j]=true;
				if(i>n-3||j==n-1||j==0)
					return cout<<"NO", 0;
				if(arr[i+1][j+1] and arr[i+1][j-1] and arr[i+1][j] and arr[i+2][j] and visited[i+1][j+1]==false and visited[i+1][j-1]==false and visited[i+1][j]==false and visited[i+2][j]==false)
					visited[i+1][j+1] = visited[i+1][j-1] = visited[i+1][j] = visited[i+2][j] = true;
				else
					return cout<<"NO", 0;
			}
		}
	}
	cout<<"YES";

	cerr << "time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/**
 * File              : B1.cpp
 * Author            : Bao To Hoai
 * Date              : 04.11.2020 16:00:12 UTC+7
 * Last Modified Date: 04.11.2020 16:12:43 UTC+7
 * Last Modified By  : Bao To Hoai
 */
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

string to_string(char c) {
    return string(1, c);
}

string to_string(string s) {
    return s;
}

template<class A, class B> string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template<class T> string to_string(T v) {
    bool f = true;
    string res = "{";
    for (auto &x : v) {
        if (!f) {
            res += ", ";
        }
        f = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

void DBG() {
    cerr << "]" << endl;
}

template<class H, class... T> void DBG(H h, T... t) {
    cerr << to_string(h);
    if(sizeof...(t))
        cerr << ", ";
    DBG(t...);
}

#ifdef LOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 42
#endif

// top, center, left, right, bot
const int dx[] = {0, 1, 1, 1, 2};
const int dy[] = {0, 0, -1, 1, 0};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    auto solve = [&]() {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (s[i][j] == '.') continue;
                for (int d = 0; d < 5; d++) {
                    int x = i + dx[d];
                    int y = j + dy[d];
                    if (x < 0 || x >= n || y < 0 || y >= n || s[x][y] == '.') return false;
                    s[x][y] = '.';
                }
            }
        }
        return true;
    };
    cout << (solve() ? "YES" : "NO") << "\n";
    return 0;
}


/**
 * File              : B.cpp
 * Author            : Bao To Hoai
 * Date              : 04.11.2020 15:24:12 UTC+7
 * Last Modified Date: 04.11.2020 15:43:52 UTC+7
 * Last Modified By  : Bao To Hoai
 */
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

string to_string(char c) {
    return string(1, c);
}

string to_string(string s) {
    return s;
}

template<class A, class B> string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template<class T> string to_string(T v) {
    bool f = true;
    string res = "{";
    for (auto &x : v) {
        if (!f) {
            res += ", ";
        }
        f = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

void DBG() {
    cerr << "]" << endl;
}

template<class H, class... T> void DBG(H h, T... t) {
    cerr << to_string(h);
    if(sizeof...(t))
        cerr << ", ";
    DBG(t...);
}

#ifdef LOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 42
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    vector<vector<bool>> vis(n, vector<bool>(n));
    auto solve = [&](int xTop, int yTop) {
        int xCenter = xTop + 1, yCenter = yTop;
        if (xCenter >= n || s[xCenter][yCenter] != '#') return false;

        int xLeft = xCenter, yLeft = yCenter - 1;
        if (yLeft < 0 || s[xLeft][yLeft] != '#') return false;

        int xRight = xCenter, yRight = yCenter + 1;
        if (yRight >= n || s[xRight][yRight] != '#') return false;

        int xBot = xCenter + 1, yBot = yCenter;
        if (xBot >= n || s[xBot][yBot] != '#') return false;

        vis[xCenter][yCenter] = true;
        vis[xLeft][yLeft] = true;
        vis[xRight][yRight] = true;
        vis[xBot][yBot] = true;
        return true;
    };
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (s[i][j] == '#' && !vis[i][j]) {
                if (!solve(i, j)) {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    puts("YES");
    return 0;
}


/**
 * File              : B.cpp
 * Author            : Bao To Hoai
 * Date              : 04.11.2020 15:24:12 UTC+7
 * Last Modified Date: 04.11.2020 15:50:41 UTC+7
 * Last Modified By  : Bao To Hoai
 */
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

string to_string(char c) {
    return string(1, c);
}

string to_string(string s) {
    return s;
}

template<class A, class B> string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template<class T> string to_string(T v) {
    bool f = true;
    string res = "{";
    for (auto &x : v) {
        if (!f) {
            res += ", ";
        }
        f = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

void DBG() {
    cerr << "]" << endl;
}

template<class H, class... T> void DBG(H h, T... t) {
    cerr << to_string(h);
    if(sizeof...(t))
        cerr << ", ";
    DBG(t...);
}

#ifdef LOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 42
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    vector<vector<bool>> vis(n, vector<bool>(n));
    auto solve = [&](int xTop, int yTop) {
        int xCenter = xTop + 1, yCenter = yTop;
        if (xCenter >= n || s[xCenter][yCenter] != '#' || vis[xCenter][yCenter]) return false;

        int xLeft = xCenter, yLeft = yCenter - 1;
        if (yLeft < 0 || s[xLeft][yLeft] != '#' || vis[xLeft][yLeft]) return false;

        int xRight = xCenter, yRight = yCenter + 1;
        if (yRight >= n || s[xRight][yRight] != '#' || vis[xRight][yRight]) return false;

        int xBot = xCenter + 1, yBot = yCenter;
        if (xBot >= n || s[xBot][yBot] != '#' || vis[xBot][yBot]) return false;

        vis[xTop][yTop] = true;
        vis[xCenter][yCenter] = true;
        vis[xLeft][yLeft] = true;
        vis[xRight][yRight] = true;
        vis[xBot][yBot] = true;
        return true;
    };

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (s[i][j] == '#' && !vis[i][j]) {
                if (!solve(i, j)) {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    puts("YES");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<pair<int, int>> off = {{0, 0}, {1, -1}, {1, 0}, {1, 1}, {2, 0}};

void draw(vector<vector<int>> &v, vector<vector<int>> &to, int i, int j){
	for(auto p : off){
		int ni = i+p.first;
		int nj = j+p.second;
		if(ni >= v.size() || nj >= v.size() || v[ni][nj] == 0){
			return;
		}
	}

	for(auto p : off){
		int ni = i+p.first;
		int nj = j+p.second;
		if(ni < v.size() && nj < v.size()){
			v[ni][nj] = 0;
		}
	}
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	vector<vector<int>> v(n, vector<int>(n));
	vector<vector<int>> to(n, vector<int>(n));
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			char c;
			cin>>c;
			if(c == '#'){
				v[i][j] = 1;
				to[i][j] = 1;
			}
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0;  j < n; j++){
			draw(v, to, i, j);
		}
	}

	for(int i = 0; i < n; i++){
		for(int j = 0;  j < n; j++){
			if(v[i][j]){
				cout << "NO";
				return 0;
			}
		}
	}
	cout << "YES";
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<pair<int, int>> off = {{0, 0}, {1, -1}, {1, 0}, {1, 1}, {2, 0}};

void draw(vector<vector<int>> &v, vector<vector<int>> &to, int i, int j){
	for(auto p : off){
		int ni = i+p.first;
		int nj = j+p.second;
		if(ni < v.size() && nj < v.size() && v[ni][nj] == 0){
			return;
		}
	}

	for(auto p : off){
		int ni = i+p.first;
		int nj = j+p.second;
		if(ni < v.size() && nj < v.size()){
			v[ni][nj] = 0;
		}
	}
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	vector<vector<int>> v(n, vector<int>(n));
	vector<vector<int>> to(n, vector<int>(n));
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			char c;
			cin>>c;
			if(c == '#'){
				v[i][j] = 1;
				to[i][j] = 1;
			}
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0;  j < n; j++){
			draw(v, to, i, j);
		}
	}

	for(int i = 0; i < n; i++){
		for(int j = 0;  j < n; j++){
			if(v[i][j]){
				cout << "NO";
				return 0;
			}
		}
	}
	cout << "YES";
}


#include <bits/stdc++.h>
#include <string>
#include <iostream>
using namespace std;
string t[100000];
long long n,k,i,mx,y[300][300],z,j;
int main()
{
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    cin >> n;
    for(i = 0; i < n; i++) cin >> t[i];

    for(i = 0; i < n; i++)
    {
        for(j = 0; j < n; j++)
        {
            if(t[i][j] == '#' and (t[i][j-1] == '#' or t[i][j+1] == '#' or t[i+1][j] == '#' or t[i-1][j])) z++;
        }
    }
    if(z % 5 >= 1) cout << "NO" << endl;
    else
        cout << "YES" << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,i,j,x,y;
    string s[105];
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>s[i];
    }
    for(i=1;i<n-1;i++)
    {
        for(j=1;j<n-1;j++)
        {
            if(s[i][j]=='#')
            {
                if(s[i-1][j]=='#' && s[i][j-1]=='#' && s[i][j+1]=='#' && s[i+1][j]=='#')
                {
                    s[i-1][j]='.';
                    s[i][j-1]='.';
                    s[i][j+1]='.';
                    s[i+1][j]='.';
                    s[i][j]='.';
                }
            }
        }
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(s[i][j]=='#')
            {
                cout<<"NO";
                return 0;
            }
        }
    }
    cout<<"YES";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ld h,l;
	cin>>h>>l;
	cout<<fixed<<setprecision(9)<<(l*l-h*h)/(2*h);
	return 0;
}


#include <bits/stdc++.h>
#define j1 D_Dubovec

using namespace std;

bool comp(int a , int b){
   return a > b;
}

int n , t , z , r;
char c[100][100];

//void MDK(){
//     MDK();
//}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
    cin >> n;
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < n ; j++){
            cin >> c[i][j];
        }
    }
    if(n % 5 == 0)cout << "YES\n";
    else cout << "NO\n";

    return 0;
}

/*
5
#....
###..
.###.
..##.
..##.
*/


#include <bits/stdc++.h>
#define j1 D_Dubovec

using namespace std;

bool comp(int a , int b){
   return a > b;
}

int n , t , z , r;
char c[100][100];

//void MDK(){
//     MDK();
//}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
    cin >> n;
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < n ; j++){
            cin >> c[i][j];
        }
    }
    if(n < 10 and n != 5){
        cout << "NO\n";
        return 0 ;
    }
    if(n % 5 == 0)cout << "YES\n";
    else cout << "NO\n";

    return 0;
}

/*
5
#....
###..
.###.
..##.
..##.
*/


#include<iostream>

using namespace std;

int main()
{
    int n,i,j,hc = 0,dc = 0;
    cin>>n;
    char board[n][n];
    for( i = 0; i < n; i++){
        for( j = 0; j < n; j++){
            cin>>board[i][j];
            if(board[i][j]=='#')
                hc++;
            else
                dc++;
        }
    }
    if(hc%5==0){
        if(dc >= (hc/5)*4)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }
    else
        cout<<"NO\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define  input(a) for(auto &it:a) cin>>it;
#define output(a) for(auto it:a) cout<<it<<" ";cout<<"\n";
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<long long>
#define pb push_back
#define ro(n) ((n/2)+(n%2!=0))
# define MAX 1000*1000*1000
const ll MOD=1e9+7;
int i,j,k,l;

void solve()
{
    int n,k=0;
    cin>>n;
    vector<string>a(n);
    for(i=0;i<n;++i)
    {
        cin>>a[i];
    }
    for(i=0;i<n;++i)
    {
        for(j=0;j<n;++j)
        {
            if(a[i][j]=='#')
            {
                if(i<n-2&&j>0&&j<n-1)
                {
                    if(a[i+1][j]=='#'&&a[i+1][j-1]=='#'&&a[i+1][j+1]=='#'&&a[i+2][j]=='#')
                    {
                        a[i][j]='.';
                        a[i+1][j]='.';
                        a[i+2][j]='.';
                        a[i+1][j-1]='.';
                        a[i+1][j+1]='.';
                    }
                    else
                    {
                        k=1;
                        break;
                    }
                }
                else
                {
                    k=1;
                    break;
                }
            }
        }
        if(k)
            break;
    }
    if(k)
        cout<<"NO";
    else
        cout<<"YES";
}

int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt" , "r" , stdin) ;
        freopen("output.txt" , "w" , stdout) ;
    #endif
    /*int t;
    cin>>t;
    while(t--)
    {
        solve();
    }*/
    solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define  input(a) for(auto &it:a) cin>>it;
#define output(a) for(auto it:a) cout<<it<<" ";cout<<"\n";
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<long long>
#define pb push_back
#define ro(n) ((n/2)+(n%2!=0))
# define MAX 1000*1000*1000
const ll MOD=1e9+7;
int i,j,k,l;

void solve()
{
    int n,k=0;
    cin>>n;
    vector<string>a(n);
    for(i=0;i<n;++i)
    {
        cin>>a[i];
    }
    for(i=0;i<n;++i)
    {
        for(j=0;j<n;++j)
        {
            if(a[i][j]=='#')
            {
                if((i==0&&j==0)||(i==n-1&&j==0)||(i==0&&j==n-1)||(i==n-1&&j==n-1))
                {
                    k=1;
                    break;
                }
                else if(i>n-2)
                {
                    if(a[i+1][j]=='#'&&a[i+1][j-1]=='#'&&a[i+1][j+1]=='#'&&a[i+2][j]=='#')
                    {
                        a[i+1][j]='.';
                        a[i+2][j]='.';
                        a[i+1][j-1]='.';
                        a[i+1][j+1]='.';
                    }
                    else
                    {
                        k=1;
                        break;
                    }
                }
                else
                {
                    k=1;
                    break;
                }
            }
        }
        if(k)
            break;
    }
    if(k)
        cout<<"NO";
    else
        cout<<"YES";
}

int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt" , "r" , stdin) ;
        freopen("output.txt" , "w" , stdout) ;
    #endif
    /*int t;
    cin>>t;
    while(t--)
    {
        solve();
    }*/
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll  mod = 1000000007;
#define pp pair<ll,ll>
typedef long double ld;
const ll long_max = 9223372036854775807;
const ll inf = INT_MAX;
#define endl "\n"
void pr(ll n) {cout<<(n)<<"\n";}
void pr(string s) {cout<<(s)<<"\n";}
void pr(pair<ll,ll> p){cout<<(p).first<<" "<<(p).second<<"\n";};
void pr(ll a,ll b) {cout<<(a)<<" "<<(b)<<"\n";}
void pr(ll a,ll b,ll c) {cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n";}
void pr(ll a,ll b,ll c,ll d) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<"\n";}
void pr(ll a,ll b,ll c,ll d,ll e) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n";}
void pr(vector<ll> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
void pr(vector<string> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
#define pr1(a) cout<<(a)<<"\n"
#define pr2(a,b) cout<<(a)<<" "<<(b)<<"\n"
#define pr3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n"
#define pr4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define pr5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define deb(x) cout << #x << "=" << x << "\n"
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << "\n"
#define prs(n) cout<<(n)<<" "
#define prp(p) cout<<(p).first<<" "<<(p).second<<", "
#define nxl   cout<<"\n"
#define all(x) x.begin(), x.end()
#define fill(x,v_l) memset(x, (v_l), sizeof(x))
#define sld(n)      scanf("%lld", &n)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      eachR(it,s)       for(auto it = s.rbegin(); it != s.rend(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), revcomp)
#define      sortp(v)          sort(v.begin(), v.end(), comp)
#define      sortfoo(v)        sort(v.begin(), v.end(), foo)
#define      rev(v)            reverse(v.begin(), v.end())
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      rep1(i,n)         for(ll i=1;i<(n);i++)
#define      rep2(i,n)         for(ll i=2;i<(n);i++)
#define      repr(i,n)         for(ll i=(n-1);i>=0;i--)
#define      repb(i,n)         for(ll i=1;i<(n-1);i++)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define popb pop_back
#define PI 3.1415926535897932384626
void decimal(int);
ll max(ll, ll);
ll multi(ll, ll);
ll add(ll, ll);
ll subtract(ll,ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll,ll);
ll power(ll,ll);
ll divi(ll,ll);
void subsetsUtil(vector<ll>&, vector<vector<ll> >&, vector<ll>&, ll);
vector<vector<ll> > subsets(vector<ll>& );
ll ncrmod(ll, ll, ll);
ll ncr(ll , ll );
ll npr(ll , ll );
ll nprmod(ll , ll );
vector<string> permutations(string);
void makeCombiUtil(vector<vector<ll> >&, vector<ll>&, ll, ll, ll);
vector<vector<ll> > makeCombi(ll, ll);
void printSubSeqRec(string, ll, ll, string);
void printSubSeq(string);
bool comp(pp a, pp b) {   if(a.first == b.first) return a.second<b.second; else return a.first<b.first; }
ll numdigit(ll n){ ll cnt = 0; while(n>0){n/=10; cnt++;} return cnt;}
pair<ld,ll> powerldpair(ld,ll);
bool isprime(ll n) { if(n<=1) return false; for(ll i = 2;i<=sqrt(n);++i) if(n%i==0) return false; return true; }
bool revcomp(ll a,ll b){ return a>b;}

void solve()
{

	ll n;
	cin>>n;
	bool arr[n][n];
	rep(i,n)
	rep(j,n)
	{
		char x;
		cin>>x;
		if(x == '.')
			arr[i][j] = true;
		else arr[i][j] = false;
	}

	rep(i,n)
	{
		rep(j,n)
		{
			if(arr[i][j]==0)
			{
				if(j==0 || j==n-1 || i>n-3)
				{
					pr("NO");
					return;
				}
				rep(k,3){

					if(arr[i+k][j] == 0)
						arr[i+k][j] == 1;
					else {
						pr("NO");
						return;
					}
				}

				if(arr[i+1][j-1] == 0)
						arr[i+1][j-1] == 1;
					else {
						pr("NO");
						return;
					}
				if(arr[i+1][j-1] == 0)
						arr[i+1][j-1] == 1;
					else {
						pr("NO");
						return;
					}

			}
		}
	}
	pr("YES");
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    ll t = 1;
    //cin>>t;

    while(t--)
    {
    	solve();
    }
    return 0;
}

ll max(ll x,ll y){
    if(x>y) return x; return y;
}

ll add(ll x,ll y){
    return ((x%mod) + (y%mod) + mod)%mod; }

ll multi(ll x,ll y){
    return ((x%mod) * (y%mod))%mod; }

ll subtract(ll x,ll y){
    return ((x%mod) - (y%mod) + mod)%mod; }
ll divi(ll a , ll b)
{
    return (a%mod * power(b,mod-2)%mod)%mod;
}

ll modpower(ll x, ll y)
{   ll p = mod; ll res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;}
    return res;}

ll power(ll a , ll b)
{ ll prod = 1;
    while(b)
    {
        if(b&1)
        {
            prod = (prod * a);
        }
        a = (a*a);
        b >>= 1;
    }
    return prod;
}
pair<ld,ll> powerldpair(ld a , ll b)
{   ld prod = 1; ll powten = 0; ll powtemp = 0;
    while(b)
    {  if(b&1)
    {
        prod = (prod * a);
        powten += powtemp;
        while(prod>=10)
        {
            prod/=10;
            powten++;
        }
    }
        a = (a*a);
        powtemp*=2;
        while(a>=10)
        {
            a/=10;
            powtemp++;
        }
        b >>= 1;
    }
    return mp(prod,powten);
}
ll gcd(ll a, ll b){
    if(b>a) swap(a,b);
    if (b == 0) return a; else return gcd(b, a % b); }

void subsetsUtil(vector<ll>& A, vector<vector<ll> >& res, vector<ll>& subset, ll index){
    res.push_back(subset);
    for (ll i = index; i < A.size(); i++) {
        subset.push_back(A[i]); subsetsUtil(A, res, subset, i + 1); subset.pop_back();}
    return;}
vector<vector<ll> > subsets(vector<ll>& A)
{    vector<ll> subset; vector<vector<ll> > res; ll index = 0;
    subsetsUtil(A, res, subset, index);
    return res;}

void decimal(int n){
    cout<<fixed;
    cout<<setprecision(n); }

ll modinv(ll n, ll p)
{ return modpower(n, p-2);}

ll ncrmod(ll n, ll r, ll p)
{if (r==0) return 1;
    ll fac[n+1]; fac[0] = 1;
    for (ll i=1 ; i<=n; i++) fac[i] = fac[i-1]*i%p;
    return (fac[n]* modinv(fac[r], p) % p * modinv(fac[n-r], p) % p) % p;}

ll ncr(ll n, ll k)
{ ll res = 1;
	if(n<k) return 0;
    if ( k > n - k ) k = n - k;
    for (ll i = 0; i < k; ++i)
    { res *= (n - i); res /= (i + 1); }
    return res; }

ll npr(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P *= (n-i) ; return P; }

ll nprmod(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P = multi(P,n-i) ; return P%mod; }

vector<string> permutations(string str)
{ vector<string> vec; sort(str.begin(), str.end());
    do { vec.pb(str); } while (next_permutation(str.begin(), str.end()));
    return vec; }

void makeCombiUtil(vector<vector<ll> >& ans, vector<ll>& tmp, ll n, ll left, ll k)
{ if (k == 0) {ans.push_back(tmp); return; }
    for (ll i = left; i <= n; ++i)
    { tmp.push_back(i);makeCombiUtil(ans, tmp, n, i + 1, k - 1); tmp.pop_back();}
}

vector<vector<ll> > makeCombi(ll n, ll k)
{   vector<vector<ll> > ans; vector<ll> tmp; makeCombiUtil(ans, tmp, n, 1, k); return ans; }

void printSubSeqRec(string str, ll n, ll index = -1, string curr = "")
{ if (index == n) return;
    cout << curr << "\n";
    for (ll i = index + 1; i < n; i++) { curr += str[i]; printSubSeqRec(str, n, i, curr); curr = curr.erase(curr.size() - 1); }
    return; }

void printSubSeq(string str)
{printSubSeqRec(str, str.size());}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll  mod = 1000000007;
#define pp pair<ll,ll>
typedef long double ld;
const ll long_max = 9223372036854775807;
const ll inf = INT_MAX;
#define endl "\n"
void pr(ll n) {cout<<(n)<<"\n";}
void pr(string s) {cout<<(s)<<"\n";}
void pr(pair<ll,ll> p){cout<<(p).first<<" "<<(p).second<<"\n";};
void pr(ll a,ll b) {cout<<(a)<<" "<<(b)<<"\n";}
void pr(ll a,ll b,ll c) {cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n";}
void pr(ll a,ll b,ll c,ll d) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<"\n";}
void pr(ll a,ll b,ll c,ll d,ll e) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n";}
void pr(vector<ll> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
void pr(vector<string> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
#define pr1(a) cout<<(a)<<"\n"
#define pr2(a,b) cout<<(a)<<" "<<(b)<<"\n"
#define pr3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n"
#define pr4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define pr5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define deb(x) cout << #x << "=" << x << "\n"
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << "\n"
#define prs(n) cout<<(n)<<" "
#define prp(p) cout<<(p).first<<" "<<(p).second<<", "
#define nxl   cout<<"\n"
#define all(x) x.begin(), x.end()
#define fill(x,v_l) memset(x, (v_l), sizeof(x))
#define sld(n)      scanf("%lld", &n)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      eachR(it,s)       for(auto it = s.rbegin(); it != s.rend(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), revcomp)
#define      sortp(v)          sort(v.begin(), v.end(), comp)
#define      sortfoo(v)        sort(v.begin(), v.end(), foo)
#define      rev(v)            reverse(v.begin(), v.end())
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      rep1(i,n)         for(ll i=1;i<(n);i++)
#define      rep2(i,n)         for(ll i=2;i<(n);i++)
#define      repr(i,n)         for(ll i=(n-1);i>=0;i--)
#define      repb(i,n)         for(ll i=1;i<(n-1);i++)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define popb pop_back
#define PI 3.1415926535897932384626
void decimal(int);
ll max(ll, ll);
ll multi(ll, ll);
ll add(ll, ll);
ll subtract(ll,ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll,ll);
ll power(ll,ll);
ll divi(ll,ll);
void subsetsUtil(vector<ll>&, vector<vector<ll> >&, vector<ll>&, ll);
vector<vector<ll> > subsets(vector<ll>& );
ll ncrmod(ll, ll, ll);
ll ncr(ll , ll );
ll npr(ll , ll );
ll nprmod(ll , ll );
vector<string> permutations(string);
void makeCombiUtil(vector<vector<ll> >&, vector<ll>&, ll, ll, ll);
vector<vector<ll> > makeCombi(ll, ll);
void printSubSeqRec(string, ll, ll, string);
void printSubSeq(string);
bool comp(pp a, pp b) {   if(a.first == b.first) return a.second<b.second; else return a.first<b.first; }
ll numdigit(ll n){ ll cnt = 0; while(n>0){n/=10; cnt++;} return cnt;}
pair<ld,ll> powerldpair(ld,ll);
bool isprime(ll n) { if(n<=1) return false; for(ll i = 2;i<=sqrt(n);++i) if(n%i==0) return false; return true; }
bool revcomp(ll a,ll b){ return a>b;}

void solve()
{

	ll n;
	cin>>n;
	bool arr[n][n];
	rep(i,n)
	rep(j,n)
	{
		char x;
		cin>>x;
		if(x == '.')
			arr[i][j] = true;
		else arr[i][j] = false;
	}

	rep(i,n)
	{
		rep(j,n)
		{
			if(arr[i][j]==0)
			{
				if(j==0 || j==n-1 || i>n-3)
				{
					pr("NO");
					return;
				}
				rep(k,3){

					if(arr[i+k][j] == 0)
						arr[i+k][j] = 1;
					else {
						pr("NO");
						return;
					}
				}

				if(arr[i+1][j-1] == 0)
						arr[i+1][j-1] = 1;
					else {
						pr("NO");
						return;
					}
				if(arr[i+1][j+1] == 0)
						arr[i+1][j+1] = 1;
					else {
						pr("NO");
						return;
					}

			}
		}
	}
	pr("YES");
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    ll t = 1;
    //cin>>t;

    while(t--)
    {
    	solve();
    }
    return 0;
}

ll max(ll x,ll y){
    if(x>y) return x; return y;
}

ll add(ll x,ll y){
    return ((x%mod) + (y%mod) + mod)%mod; }

ll multi(ll x,ll y){
    return ((x%mod) * (y%mod))%mod; }

ll subtract(ll x,ll y){
    return ((x%mod) - (y%mod) + mod)%mod; }
ll divi(ll a , ll b)
{
    return (a%mod * power(b,mod-2)%mod)%mod;
}

ll modpower(ll x, ll y)
{   ll p = mod; ll res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;}
    return res;}

ll power(ll a , ll b)
{ ll prod = 1;
    while(b)
    {
        if(b&1)
        {
            prod = (prod * a);
        }
        a = (a*a);
        b >>= 1;
    }
    return prod;
}
pair<ld,ll> powerldpair(ld a , ll b)
{   ld prod = 1; ll powten = 0; ll powtemp = 0;
    while(b)
    {  if(b&1)
    {
        prod = (prod * a);
        powten += powtemp;
        while(prod>=10)
        {
            prod/=10;
            powten++;
        }
    }
        a = (a*a);
        powtemp*=2;
        while(a>=10)
        {
            a/=10;
            powtemp++;
        }
        b >>= 1;
    }
    return mp(prod,powten);
}
ll gcd(ll a, ll b){
    if(b>a) swap(a,b);
    if (b == 0) return a; else return gcd(b, a % b); }

void subsetsUtil(vector<ll>& A, vector<vector<ll> >& res, vector<ll>& subset, ll index){
    res.push_back(subset);
    for (ll i = index; i < A.size(); i++) {
        subset.push_back(A[i]); subsetsUtil(A, res, subset, i + 1); subset.pop_back();}
    return;}
vector<vector<ll> > subsets(vector<ll>& A)
{    vector<ll> subset; vector<vector<ll> > res; ll index = 0;
    subsetsUtil(A, res, subset, index);
    return res;}

void decimal(int n){
    cout<<fixed;
    cout<<setprecision(n); }

ll modinv(ll n, ll p)
{ return modpower(n, p-2);}

ll ncrmod(ll n, ll r, ll p)
{if (r==0) return 1;
    ll fac[n+1]; fac[0] = 1;
    for (ll i=1 ; i<=n; i++) fac[i] = fac[i-1]*i%p;
    return (fac[n]* modinv(fac[r], p) % p * modinv(fac[n-r], p) % p) % p;}

ll ncr(ll n, ll k)
{ ll res = 1;
	if(n<k) return 0;
    if ( k > n - k ) k = n - k;
    for (ll i = 0; i < k; ++i)
    { res *= (n - i); res /= (i + 1); }
    return res; }

ll npr(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P *= (n-i) ; return P; }

ll nprmod(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P = multi(P,n-i) ; return P%mod; }

vector<string> permutations(string str)
{ vector<string> vec; sort(str.begin(), str.end());
    do { vec.pb(str); } while (next_permutation(str.begin(), str.end()));
    return vec; }

void makeCombiUtil(vector<vector<ll> >& ans, vector<ll>& tmp, ll n, ll left, ll k)
{ if (k == 0) {ans.push_back(tmp); return; }
    for (ll i = left; i <= n; ++i)
    { tmp.push_back(i);makeCombiUtil(ans, tmp, n, i + 1, k - 1); tmp.pop_back();}
}

vector<vector<ll> > makeCombi(ll n, ll k)
{   vector<vector<ll> > ans; vector<ll> tmp; makeCombiUtil(ans, tmp, n, 1, k); return ans; }

void printSubSeqRec(string str, ll n, ll index = -1, string curr = "")
{ if (index == n) return;
    cout << curr << "\n";
    for (ll i = index + 1; i < n; i++) { curr += str[i]; printSubSeqRec(str, n, i, curr); curr = curr.erase(curr.size() - 1); }
    return; }

void printSubSeq(string str)
{printSubSeqRec(str, str.size());}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll  mod = 1000000007;
#define pp pair<ll,ll>
typedef long double ld;
const ll long_max = 9223372036854775807;
const ll inf = INT_MAX;
#define endl "\n"
void pr(ll n) {cout<<(n)<<"\n";}
void pr(string s) {cout<<(s)<<"\n";}
void pr(pair<ll,ll> p){cout<<(p).first<<" "<<(p).second<<"\n";};
void pr(ll a,ll b) {cout<<(a)<<" "<<(b)<<"\n";}
void pr(ll a,ll b,ll c) {cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n";}
void pr(ll a,ll b,ll c,ll d) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<"\n";}
void pr(ll a,ll b,ll c,ll d,ll e) {cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n";}
void pr(vector<ll> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
void pr(vector<string> v){ for(int i = 0;i<v.size();++i) cout<<v[i]<<" "; cout<<"\n";}
#define pr1(a) cout<<(a)<<"\n"
#define pr2(a,b) cout<<(a)<<" "<<(b)<<"\n"
#define pr3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n"
#define pr4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define pr5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define deb(x) cout << #x << "=" << x << "\n"
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << "\n"
#define prs(n) cout<<(n)<<" "
#define prp(p) cout<<(p).first<<" "<<(p).second<<", "
#define nxl   cout<<"\n"
#define all(x) x.begin(), x.end()
#define fill(x,v_l) memset(x, (v_l), sizeof(x))
#define sld(n)      scanf("%lld", &n)
#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      eachR(it,s)       for(auto it = s.rbegin(); it != s.rend(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), revcomp)
#define      sortp(v)          sort(v.begin(), v.end(), comp)
#define      sortfoo(v)        sort(v.begin(), v.end(), foo)
#define      rev(v)            reverse(v.begin(), v.end())
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      rep1(i,n)         for(ll i=1;i<(n);i++)
#define      rep2(i,n)         for(ll i=2;i<(n);i++)
#define      repr(i,n)         for(ll i=(n-1);i>=0;i--)
#define      repb(i,n)         for(ll i=1;i<(n-1);i++)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define popb pop_back
#define PI 3.1415926535897932384626
void decimal(int);
ll max(ll, ll);
ll multi(ll, ll);
ll add(ll, ll);
ll subtract(ll,ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll,ll);
ll power(ll,ll);
ll divi(ll,ll);
void subsetsUtil(vector<ll>&, vector<vector<ll> >&, vector<ll>&, ll);
vector<vector<ll> > subsets(vector<ll>& );
ll ncrmod(ll, ll, ll);
ll ncr(ll , ll );
ll npr(ll , ll );
ll nprmod(ll , ll );
vector<string> permutations(string);
void makeCombiUtil(vector<vector<ll> >&, vector<ll>&, ll, ll, ll);
vector<vector<ll> > makeCombi(ll, ll);
void printSubSeqRec(string, ll, ll, string);
void printSubSeq(string);
bool comp(pp a, pp b) {   if(a.first == b.first) return a.second<b.second; else return a.first<b.first; }
ll numdigit(ll n){ ll cnt = 0; while(n>0){n/=10; cnt++;} return cnt;}
pair<ld,ll> powerldpair(ld,ll);
bool isprime(ll n) { if(n<=1) return false; for(ll i = 2;i<=sqrt(n);++i) if(n%i==0) return false; return true; }
bool revcomp(ll a,ll b){ return a>b;}

void solve()
{

	ll n;
	cin>>n;
	bool arr[n][n];
	rep(i,n)
	rep(j,n)
	{
		char x;
		cin>>x;
		if(x == '.')
			arr[i][j] = true;
		else arr[i][j] = false;
	}

	rep(i,n)
	{
		rep(j,n)
		{
			if(arr[i][j]==0)
			{
				if(j==0 || j==n-1 || i>n-3)
				{
					pr("NO");
					return;
				}
				rep(k,3)
					arr[i+k][j] = 1;
				arr[i+1][j-1] = 1;
				arr[i+1][j+1] = 1;

			}
		}
	}
	pr("YES");
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    ll t = 1;
    //cin>>t;

    while(t--)
    {
    	solve();
    }
    return 0;
}

ll max(ll x,ll y){
    if(x>y) return x; return y;
}

ll add(ll x,ll y){
    return ((x%mod) + (y%mod) + mod)%mod; }

ll multi(ll x,ll y){
    return ((x%mod) * (y%mod))%mod; }

ll subtract(ll x,ll y){
    return ((x%mod) - (y%mod) + mod)%mod; }
ll divi(ll a , ll b)
{
    return (a%mod * power(b,mod-2)%mod)%mod;
}

ll modpower(ll x, ll y)
{   ll p = mod; ll res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;}
    return res;}

ll power(ll a , ll b)
{ ll prod = 1;
    while(b)
    {
        if(b&1)
        {
            prod = (prod * a);
        }
        a = (a*a);
        b >>= 1;
    }
    return prod;
}
pair<ld,ll> powerldpair(ld a , ll b)
{   ld prod = 1; ll powten = 0; ll powtemp = 0;
    while(b)
    {  if(b&1)
    {
        prod = (prod * a);
        powten += powtemp;
        while(prod>=10)
        {
            prod/=10;
            powten++;
        }
    }
        a = (a*a);
        powtemp*=2;
        while(a>=10)
        {
            a/=10;
            powtemp++;
        }
        b >>= 1;
    }
    return mp(prod,powten);
}
ll gcd(ll a, ll b){
    if(b>a) swap(a,b);
    if (b == 0) return a; else return gcd(b, a % b); }

void subsetsUtil(vector<ll>& A, vector<vector<ll> >& res, vector<ll>& subset, ll index){
    res.push_back(subset);
    for (ll i = index; i < A.size(); i++) {
        subset.push_back(A[i]); subsetsUtil(A, res, subset, i + 1); subset.pop_back();}
    return;}
vector<vector<ll> > subsets(vector<ll>& A)
{    vector<ll> subset; vector<vector<ll> > res; ll index = 0;
    subsetsUtil(A, res, subset, index);
    return res;}

void decimal(int n){
    cout<<fixed;
    cout<<setprecision(n); }

ll modinv(ll n, ll p)
{ return modpower(n, p-2);}

ll ncrmod(ll n, ll r, ll p)
{if (r==0) return 1;
    ll fac[n+1]; fac[0] = 1;
    for (ll i=1 ; i<=n; i++) fac[i] = fac[i-1]*i%p;
    return (fac[n]* modinv(fac[r], p) % p * modinv(fac[n-r], p) % p) % p;}

ll ncr(ll n, ll k)
{ ll res = 1;
	if(n<k) return 0;
    if ( k > n - k ) k = n - k;
    for (ll i = 0; i < k; ++i)
    { res *= (n - i); res /= (i + 1); }
    return res; }

ll npr(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P *= (n-i) ; return P; }

ll nprmod(ll n, ll k)
{ ll P = 1; for (ll i = 0; i < k; i++) P = multi(P,n-i) ; return P%mod; }

vector<string> permutations(string str)
{ vector<string> vec; sort(str.begin(), str.end());
    do { vec.pb(str); } while (next_permutation(str.begin(), str.end()));
    return vec; }

void makeCombiUtil(vector<vector<ll> >& ans, vector<ll>& tmp, ll n, ll left, ll k)
{ if (k == 0) {ans.push_back(tmp); return; }
    for (ll i = left; i <= n; ++i)
    { tmp.push_back(i);makeCombiUtil(ans, tmp, n, i + 1, k - 1); tmp.pop_back();}
}

vector<vector<ll> > makeCombi(ll n, ll k)
{   vector<vector<ll> > ans; vector<ll> tmp; makeCombiUtil(ans, tmp, n, 1, k); return ans; }

void printSubSeqRec(string str, ll n, ll index = -1, string curr = "")
{ if (index == n) return;
    cout << curr << "\n";
    for (ll i = index + 1; i < n; i++) { curr += str[i]; printSubSeqRec(str, n, i, curr); curr = curr.erase(curr.size() - 1); }
    return; }

void printSubSeq(string str)
{printSubSeqRec(str, str.size());}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i < n-2;i++)
    {
        for(j = 1;j < n  - 1;j++)
        {
            if(s3[i][j] == "#" and s3[i+1][j] == "#" and s3[i+1][j-1] == "#" and s3[i+1][j+1] == "#" and s3[i + 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i+1][j] = ".";
           s3[i+1][j-1] = ".";
           s3[i+1][j+1] = ".";
           s3[i + 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i <= n-2;i++)
    {
        for(j = 1;j < n  - 1;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i < n-1;i++)
    {
        for(j = 1;j < n;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i <= n-2;i++)
    {
        for(j = 1;j < n;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 2;i <= n-2;i++)
    {
        for(j = 1;j < n  - 1;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[1001], s1 , s5, s3[1001][1001], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i < n;i++)
    {
        for(j = 1;j < n;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 0;i < n;i++)
    {
        for(j = 1;j < n;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


///#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define endl "\n"

using namespace std;

//#define for(i, n) for (int i = 0; i < (n); i++)
//#define for(i, n, b) for (int i = (n); i < (b); i++)
//#define for(i, n) for (int i = (n) - 1; i >= 0; i--)
//#define ford(i, n, b) for (int i = (n) - 1; i >= (a); i--)
/// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
#define whi while
#define br break
#define cn continue
#define ch char

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef string str;
typedef stringstream sstr;

ll t, n, a[1001][1001], b[100001], k = 0, mx = -1e9, mn = 1e9, l, r, i, j, e1 ,jj = 0, lol = 0, kek = 0;
str s[101], s1 , s5, s3[101][101], s2;
int main() {

	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   //freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
	cin >> n;
    for(i = 0;i < n;i++)
    {
        cin >> s[i];
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)s3[i][j] = s[i][j];

    }

    for(i = 1;i <= n-2;i++)
    {
        for(j = 1;j < n  - 1;j++)
        {
            if(s3[i][j] == "#" and s3[i-1][j] == "#" and s3[i-1][j-1] == "#" and s3[i-1][j+1] == "#" and s3[i - 2][j] == "#")
            {
           s3[i][j] = ".";
           s3[i-1][j] = ".";
           s3[i-1][j-1] = ".";
           s3[i-1][j+1] = ".";
           s3[i - 2][j] = ".";
            }
        }
    }
     for(i = 0;i < n;i++)
    {
        for(j = 0;j < n;j++)
        {
        if(s3[i][j] == "#")
        {
            cout<<"NO"<<endl;
            return 0;
        }
        }
    }
    cout<<"YES"<<endl;
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
//
#define si set<int>
#define sc set<char>
#define lcm(a,b) a*b/__gcd(a,b)
#define siitr set<int>::iterator
#define scit set<char>::iterator
#define mp make_pair
#define mapint map<int, int >
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vb vector<bool>
#define vd vector<double>
#define vviitr vector<vector<int> >::iterator
#define vvi vector<vector<int> >
#define vvc vector< vector<char> >
#define vvb vector<vector<bool> >
#define viitr vector<int>::iterator
#define vcitr vector<char>::iterator
#define f(i,j,n,k) for(int i=j;i<=n;i+=k)
#define all(c) c.begin(),c.end()
#define pb push_back
#define ll long long
#define endl '\n'
#define hell 998244353

using namespace std;
int gcdfun(int x, int y){
	if(y==0) return x;
	else return gcdfun(y,x%y);
}
int main(){

#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	// time 1:15

	int n,cnt=0 ; cin>>n;
	vvc v(n,vc(n));
	f(i,0,n-1,1){
		f(j,0,n-1,1){
			cin>>v[i][j];
			if(v[i][j]=='#') cnt++;
		}
	}
	int ans=0; //cout<<cnt<<endl;
	if(cnt%5!=0) { cout<<"NO"; return 0;}
	f(i,1,n-2,1){
		f(j,1,n-2,1){
			if(v[i][j]=='#' && v[i+1][j]=='#' && v[i-1][j]=='#' && v[i][j+1]=='#' && v[i][j-1]=='#'){
				ans++;
				v[i][j]='.'; v[i+1][j]='.' ;v[i-1][j]='.' ; v[i][j+1]='.'; v[i][j-1]='.';
			}
		}
	}
	//cout<<ans<<endl;
	if(ans == cnt/5){ cout<<"YES"; return 0;}
	cout<<"NO";
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
//
#define si set<int>
#define sc set<char>
#define lcm(a,b) a*b/__gcd(a,b)
#define siitr set<int>::iterator
#define scit set<char>::iterator
#define mp make_pair
#define mapint map<int, int >
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vb vector<bool>
#define vd vector<double>
#define vviitr vector<vector<int> >::iterator
#define vvi vector<vector<int> >
#define vvc vector< vector<char> >
#define vvb vector<vector<bool> >
#define viitr vector<int>::iterator
#define vcitr vector<char>::iterator
#define f(i,j,n,k) for(int i=j;i<=n;i+=k)
#define all(c) c.begin(),c.end()
#define pb push_back
#define ll long long
#define endl '\n'
#define hell 998244353

using namespace std;
int gcdfun(int x, int y){
	if(y==0) return x;
	else return gcdfun(y,x%y);
}
int main(){

#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	// time 1:15

	int n,cnt=0 ; cin>>n;
	vvc v(n,vc(n));
	f(i,0,n-1,1){
		f(j,0,n-1,1){
			cin>>v[i][j];
			if(v[i][j]=='#') cnt++;
		}
	}
	int ans=0;
	if(cnt%5!=0) { cout<<"NO"; return 0;}
	f(i,1,n-2,1){
		f(j,1,n-2,1){
			if(v[i][j]=='#' && v[i+1][j]=='#' && v[i-1][j]=='#' && v[i][j+1]=='#' && v[i][j-1]=='#'){
				ans++;
				v[i][j]=='.'; v[i+1][j]=='.' ;v[i-1][j]=='.' ; v[i][j+1]=='.'; v[i][j-1]=='.';
			}
		}
	}
	if(ans == cnt/5){ cout<<"YES"; return 0;}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
#include <complex>

#define mp make_pair
#define pb push_back
#define se second
#define fi first
#define M_PI 3.14159265358979323846

typedef long long ll;
typedef long double ld;
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
typedef complex<long double> base;
const int NUM = 2e3 + 5;
const ll mod = 1e9 + 7;
const ll INF = 1e18;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int n;
    cin >> n;
    string s[n];
    for (int i = 0; i < n; i++)
        cin >> s[i];
    int col[n][n];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            col[i][j] = -1;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++){
            if (s[i][j] == '.')
                continue;
            if (i - 1 < 0 || s[i - 1][j] != '#')
                continue;
            if (i + 1 >= n || s[i + 1][j] != '#')
                continue;
            if (j - 1 < 0 || s[i][j - 1] != '#')
                continue;
            if (j + 1 >= n || s[i][j + 1] != '#')
                continue;
            if (col[i - 1][j] != -1 || col[i + 1][j] != -1 || col[i][j + 1] != -1 || col[i][j - 1] != -1)
                continue;
            col[i][j] = 1;
            col[i - 1][j] = 1;
            col[i + 1][j] = 1;
            col[i][j - 1] = 1;
            col[i][j + 1] = 1;
        }
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            if (s[i][j] == '#' && col[i][j] == -1){
                cout << "NO";
                return 0;
            }
    cout << "YES";
    return 0;
}


#include <bits/stdc++.h>
#include <complex>

#define mp make_pair
#define pb push_back
#define se second
#define fi first
#define M_PI 3.14159265358979323846

typedef long long ll;
typedef long double ld;
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
typedef complex<long double> base;
const int NUM = 2e3 + 5;
const ll mod = 1e9 + 7;
const ll INF = 1e18;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int n;
    cin >> n;
    string s[n];
    for (int i = 0; i < n; i++)
        cin >> s[i];
    int col[n][n];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            col[i][j] = -1;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++){
            if (s[i][j] == '.')
                continue;
            if (i - 1 < 0 || s[i - 1][j] != '#')
                continue;
            if (i + 1 >= n || s[i + 1][j] != '#')
                continue;
            if (j - 1 < 0 || s[i][j - 1] != '#')
                continue;
            if (j + 1 >= n || s[i][j + 1] != '#')
                continue;
            if (col[i - 1][j] != -1 || col[i + 1][j] != -1 || col[i][j + 1] != -1 || col[i][j - 1] != -1){
                cout << "NO";
                return 0;
            }
            col[i][j] = 1;
            col[i - 1][j] = 1;
            col[i + 1][j] = 1;
            col[i][j - 1] = 1;
            col[i][j + 1] = 1;
        }
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            if (s[i][j] == '#' && col[i][j] == -1){
                cout << "NO";
                return 0;
            }
    cout << "YES";
    return 0;
}


#include <bits/stdc++.h>
#define f(i, n) for (i = 0; i < n; ++i)
using namespace std;

int main()
{
    vector<pair<int,int>>  Offset = {{1,0},{1,-1},{1,1},{2,0}};
    vector<string> B;

    bool poss = true;
    int n, i, j, k;

    cin>>n;
    B.resize(n);

    f(i,n) cin>>B[i];
    auto isValid = [n](int x, int y)
    {
        return 0<=x && x<n && 0<=y && y<n;
    };
    vector< vector<bool > > v ( n, vector<bool> (n,false));

    f(i,n){f(j,n)
    {

        if( B[i][j] == '#' && !v[i][j])
        {
            v[i][j] = true;

            for( auto &[d1,d2]: Offset)
            {
                int x = i+d1, y = j+d2;

                if( isValid(x,y) && !v[x][y] && B[x][y]== '#'  )
                    v[x][y] = true;
                else
                {
                    poss = false;
                    break;
                }

            }
        }
    }
    }

    if(poss) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
#define ll unsigned long long
#define f(i, n) for (i = 0; i < n; ++i)
#define F_IO                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int main()
{
    int n, i, j, k;
    cin>>n;
    vector<pair<int,int>> Off{{1, 0}, {1, -1}, {1, 1}, {2, 0}};
    vector<string> Board ( n );
    vector<vector<bool>> visited(n, vector<bool>(n, false));

    auto isValid = [n](int x, int y) {
        return 0 <= x && x < n && 0 <= y && y < n;
    };

    f(i, n)cin >> Board[i];

    bool poss = true;

    f(i, n) f(j, n)
    {
        if (Board[i][j] == '#')
        {
            if (!visited[i][j])
            {
                for (auto [x, y] : Off)
                {
                if( isValid(x+i,y+j) && Board[i][j]=='#' && !visited[i][j] )
                    visited[i+x][y+j] = true;

                else
                    poss = false;break;
                }
                visited[i][j] = true;
            }
        }

        if (!poss)
            break;
    }

    if(poss) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
#define ll unsigned long long
#define f(i, n) for (i = 0; i < n; ++i)
#define F_IO                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int main()
{
    int n, i, j, k;
    cin>>n;
    vector<pair<int,int>> Off{{1, 0}, {1, -1}, {1, 1}, {2, 0}};
    vector<string> Board ( n );
    vector<vector<bool>> visited(n, vector<bool>(n, false));

    auto isValid = [n](int x, int y) {
        return 0 <= x && x < n && 0 <= y && y < n;
    };

    f(i, n)cin >> Board[i];

    bool poss = true;

    f(i, n) f(j, n)
    {
        if (Board[i][j] == '#')
        {
            if (!visited[i][j])
            {
                for (auto [x, y] : Off)
                {
                if( isValid(x+i,y+j) && Board[i][j]=='#' && !visited[i][j] )
                    visited[i][j] = true;

                else
                    poss = false;break;
                }
            }
        }

        if (!poss)
            break;
    }

    if(poss) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


/*
                IftekharMd.Shishir
                Dept. of Information and Communication Engineering
                University of Rajshahi
                24.05.20
*/

#include<bits/stdc++.h>

#include<iostream>
#include<stdio.h>
#include<vector>
#include<array>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<string>
#include<queue>
#include<sstream>
#include<stdlib.h>
#include<iterator>

#define ll  long long int
#define ull  unsigned long long int
#define f(i,n)  for(i=0;i<n;i++)
#define F(i,n)  for(i=n-1;i>=0;i--)
#define fa(i,a,b)  for(i=a;i<=b;i++)
#define Fa(i,a,b)  for(i=a;i>=b;i--)
#define LT(i,a,n)  f(i,n)cout<<a[i]<<" "; cout<<endl;

#define vec  vector<long long int>
#define vecit  vec::iterator
#define ved  vector<double>
#define st  set<ll>
#define stid  set<ll,greater<ll> >
#define stit  set<ll>::iterator
#define Mst  multiset<ll>
#define Mstid  multiset<ll,greater<ll> >
#define Mstit  multiset<ll>::iterator

#define mpi  map<ll,ll>
#define mps  map<string,ll>
#define mpit  mp::iterator
#define mpsit  mps::iterator
#define pi  pair<ll,ll>
#define ps  pair<string,ll>

#define ary(x)  array<ll,x>    // a.at        a.fill(x)       a.swap(b)
#define que  queue<ll>
#define tpl  tuple<ll,ll,ll>    //a=make_tuple(x, y, z)     get<0>(a)

#define pb(x)  push_back(x)
#define pob()  pop_back()
#define all(a)  a.begin(),a.end()
#define sor(a)  sort(a.begin(),a.end())
#define rev(a)  reverse(a.begin(),a.end())
#define ins(a,x)  insert(a.begin(),x)
#define mem(a,x)  memset(a,x,sizeof(a))    // Array filling

#define bs  binary_search
#define lb  lower_bound
#define ub  upper_bound
#define mp  make_pair

#define FastIO  ios::sync_with_stdio(false);cin.tie(nullptr);
#define points(x)  fixed<<setprecision(x)
#define gcd(x,y)  __gcd(x,y)
#define scd(a,x,y)  a/gcd(x,y);
#define nl  cout<<endl;
#define done  return 0

const double PI= 2*acos(0.0);
const long long MOD= 1000000007;

/*----------[ string to integer ]--------------
string str;  int x=0;
stringstream demo(str);
demo >> x;
cout<< x <<endl;
*/

/*----------[ integer to string ]--------------
string name;  int x=345;
stringstream demo;
demo << x;
name=demo.str();
cout<< name <<endl;
*/

using namespace std;

int main()
{
    ll i,n,j;
    cin>>n;
    char a[n+2][n+2];

    f(i,n+2)
    {
        f(j,n+2)
        {
            a[i][j]='0';
        }
    }
    fa(i,1,n)fa(j,1,n)
    {
        cin>>a[i][j];
    }
    fa(i,1,n)fa(j,1,n)
    {
        if(a[i][j]=='#')
        {
            /*
                     #
                    ###
                     #
            */

            if(a[i][j]=='#' && a[i+1][j]=='#'&&a[i+2][j]=='#'&& a[i+1][j+1]=='#'&&a[i+1][j-1]=='#') continue;
            else if(a[i][j]=='#'&&a[i][j+1]=='#'&&a[i][j+2]=='#'&&a[i-1][j+1]=='#'&&a[i+1][j+1]=='#') continue;
            else if(a[i][j]=='#'&&a[i][j-1]=='#'&&a[i][j+1]=='#'&&a[i-1][j]=='#'&&a[i+1][j]=='#') continue;
            else if(a[i][j]=='#'&&a[i][j-1]=='#'&&a[i][j-2]=='#'&&a[i-1][j-1]=='#'&&a[i+1][j-1]=='#') continue;
            else if(a[i][j]=='#'&&a[i-1][j]=='#'&&a[i-2][j]=='#'&&a[i-1][j-1]=='#'&&a[i-1][j+1]=='#') continue;
            else
            {
                cout<<"NO"<<endl;
                done;
            }
        }
    }
    cout<<"YES"<<endl;
    done;
}


/*
                IftekharMd.Shishir
                Dept. of Information and Communication Engineering
                University of Rajshahi
                28.05.20
*/

#include<bits/stdc++.h>

#include<iostream>
#include<stdio.h>
#include<vector>
#include<array>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<string>
#include<queue>
#include<sstream>
#include<stdlib.h>
#include<iterator>

#define ll  long long int
#define ull  unsigned long long int
#define f(i,n)  for(i=0;i<n;i++)
#define F(i,n)  for(i=n-1;i>=0;i--)
#define fa(i,a,b)  for(i=a;i<=b;i++)
#define Fa(i,a,b)  for(i=a;i>=b;i--)
#define LT(i,a,n)  f(i,n)cout<<a[i]<<" "; cout<<endl;

#define vec  vector<long long int>
#define vecit  vec::iterator
#define ved  vector<double>
#define st  set<ll>
#define stid  set<ll,greater<ll> >
#define stit  set<ll>::iterator
#define Mst  multiset<ll>
#define Mstid  multiset<ll,greater<ll> >
#define Mstit  multiset<ll>::iterator

#define mpi  map<ll,ll>
#define mps  map<string,ll>
#define mpit  mp::iterator
#define mpsit  mps::iterator
#define pi  pair<ll,ll>
#define ps  pair<string,ll>

#define ary(x)  array<ll,x>    // a.at        a.fill(x)       a.swap(b)
#define que  queue<ll>
#define tpl  tuple<ll,ll,ll>    //a=make_tuple(x, y, z)     get<0>(a)

#define pb(x)  push_back(x)
#define pob()  pop_back()
#define all(a)  a.begin(),a.end()
#define sor(a)  sort(a.begin(),a.end())
#define rev(a)  reverse(a.begin(),a.end())
#define ins(a,x)  insert(a.begin(),x)
#define mem(a,x)  memset(a,x,sizeof(a))    // Array filling

#define bs  binary_search
#define lb  lower_bound
#define ub  upper_bound
#define mp  make_pair

#define FastIO  ios::sync_with_stdio(false);cin.tie(nullptr);
#define points(x)  fixed<<setprecision(x)
#define gcd(x,y)  __gcd(x,y)
#define scd(a,x,y)  a/gcd(x,y);
#define nl  cout<<endl;
#define done  return 0

const double PI= 2*acos(0.0);
const long long MOD= 1000000007;

/*----------[ string to integer ]--------------
string str;  int x=0;
stringstream demo(str);
demo >> x;
cout<< x <<endl;
*/

/*----------[ integer to string ]--------------
string name;  int x=345;
stringstream demo;
demo << x;
name=demo.str();
cout<< name <<endl;
*/

using namespace std;

int main()
{
    ll i,n,j;
    cin>>n;
    char a[n+2][n+2];

    f(i,n+2)
    {
        f(j,n+2)
        {
            a[i][j]='0';
        }
    }
    fa(i,1,n)fa(j,1,n)
    {
        cin>>a[i][j];
    }
    fa(i,1,n)fa(j,1,n)
    {
        if(a[i][j]=='#')
        {
            /*
                     #
                    ###
                     #
            */

            if(a[i][j]=='#' && a[i+1][j]=='#'&&a[i+2][j]=='#'&& a[i+1][j+1]=='#'&&a[i+1][j-1]=='#')
            {
                    a[i][j]=a[i+1][j]=a[i+2][j]=a[i+1][j+1]=a[i+1][j-1]='.';
                    continue;
            }
            else if(a[i][j]=='#'&&a[i][j+1]=='#'&&a[i][j+2]=='#'&&a[i-1][j+1]=='#'&&a[i+1][j+1]=='#')
            {
                    a[i][j]=a[i][j+1]=a[i][j+2]=a[i-1][j+1]=a[i+1][j+1]='.';
                    continue;
            }
            else if(a[i][j]=='#'&&a[i][j-1]=='#'&&a[i][j+1]=='#'&&a[i-1][j]=='#'&&a[i+1][j]=='#')
            {
                    a[i][j]=a[i][j-1]=a[i][j+1]=a[i-1][j]=a[i+1][j]='.';
                    continue;
            }
            else if(a[i][j]=='#'&&a[i][j-1]=='#'&&a[i][j-2]=='#'&&a[i-1][j-1]=='#'&&a[i+1][j-1]=='#')
            {
                    a[i][j]=a[i][j-1]=a[i][j-2]=a[i-1][j-1]=a[i+1][j-1]='.';
                    continue;
            }
            else if(a[i][j]=='#'&&a[i-1][j]=='#'&&a[i-2][j]=='#'&&a[i-1][j-1]=='#'&&a[i-1][j+1]=='#')
            {
                    a[i][j]=a[i-1][j]=a[i-2][j]=a[i-1][j-1]=a[i-1][j+1]='.';
                    continue;
            }
            else
            {
                cout<<"NO"<<endl;
                done;
            }
        }
    }
    cout<<"YES"<<endl;
    done;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<ll,ll>
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repd(i,a,b) for(ll i=a;i>=b;--i)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mit(m) for(map<int, int > :: iterator it=m.begin();it!=m.end();++it)
#define mp make_pair
#define hell 998244353
#define endl '\n'
#define vvll vector<vector<ll> >
#define vll vector<ll>
#define mint map<int,int>
#define int long long
#define sll set<int>
#define pll pair<int,int>
#define mset(a,b) memset(a,b,sizeof a)
#define sz(a) a.size()

signed main(){
    fastio;
    int n;
    cin>>n;
    string s[n];
    rep(i,0,n)
    cin>>s[i];
    rep(i,0,n){
        rep(j,0,n){
            if(i>0 && j>0 && i<n-1 && j<n-1){
                if(s[i][j]=='#'&&s[i-1][j]=='#'&&s[i+1][j]=='#'&&s[i][j-1]=='#'&&s[i][j+1]=='#'){
                    s[i][j]='*';
                    s[i-1][j]='*';
                    s[i+1][j]='*';
                    s[i][j-1]='*';
                    s[i][j+1]='*';

            }
                }
        }
    }
    int cnt=0;
    rep(i,0,n)
    rep(j,0,n)
    if(s[i][j]=='#')
        ++cnt;
    if(cnt)
        cout<<"NO";
    else
        cout<<"YES";

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<ll,ll>
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repd(i,a,b) for(ll i=a;i>=b;--i)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mit(m) for(map<int, int > :: iterator it=m.begin();it!=m.end();++it)
#define mp make_pair
#define hell 998244353
#define endl '\n'
#define vvll vector<vector<ll> >
#define vll vector<ll>
#define mint map<int,int>
#define int long long
#define sll set<int>
#define pll pair<int,int>
#define mset(a,b) memset(a,b,sizeof a)
#define sz(a) a.size()

signed main(){
    fastio;
    int n;
    cin>>n;
    string s[n];
    rep(i,0,n)
    cin>>s[i];
    rep(i,0,n){
        rep(j,0,n){
            if(i>0 && j>0 && i<n-1 && j<n-1){
                if(s[i][j]=='#'&&s[i-1][j]=='#'&&s[i+1][j]=='#'&&s[i][j-1]=='#'&&s[i][j+1]=='#'){
                    s[i][j]='*';
                    s[i-1][j]='*';
                    s[i+1][j]='*';
                    s[i][j-1]='*';
                    s[i][j+1]='*';

            }
                }
        }
    }
    int cnt=0;
    rep(i,0,n)
    rep(j,0,n)
    if(s[i][j]=='#')
        ++cnt;
    if(cnt)
        cout<<"No";
    else
        cout<<"Yes";

}


#include <iostream>
#include <cstdio>
#include <iomanip>

using namespace std;

int i,j,z,n,m,k,a[100][100],mx,ans,x1,x2,x3,x4;
string s;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    cin >> n;
    getline(cin, s);
    for(i = 0; i < n; i++){
        getline(cin, s);
        for(j = 0; j < n; j++){
            if(s[j] == '.') a[i][j] = 0;
            if(s[j] == '#') a[i][j] = 1;
            }
    }
    for(i = 0; i < n; i++){
        for(j = 0; j < n; j++){
            if(a[i][j] == 1){
                a[i][j] = 0;
                if(a[i+1][j] == 1) a[i+1][j] = 0;
                else{
                    cout << "NO";
                    return 0;
                }
                if(a[i+1][j-1] == 1) a[i+1][j-1] = 0;
                else{
                    cout << "NO";
                    return 0;
                }
                if(a[i+1][j+1] == 1) a[i+1][j+1] = 0;
                else{
                    cout << "NO";
                    return 0;
                }
                if(a[i+2][j] == 1) a[i+2][j] = 0;
                else{
                    cout << "NO";
                    return 0;
                }
            }
        }
    }
    cout << "YES";

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< long long > v(n) ;
	bool flag= false ;
	long long a= 1;
	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;
	    a= a*v[i];
	    if( v[i]== 0 ){
	        flag= true;
	        break ;

	    }

	}
	long long ans = a;
	if( flag ==false  ) {

    	for( int i= 0 ; i <n ; i++) {
    	    long long  t= -v[i]-1 ;
    	    a= (a*t)/v[i];
    	    if( a>ans ){
    	        ans = a ;
    	        v[i] = t;
    	    }
    	}
	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<endl;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< long long > v(n) ;
	bool flag= false ;

	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;

	}

    	for( int i= 0 ; i <n ; i++) {
    	   if( v[i] >= 0 ){

    	       long long t= -v[i]-1;
    	       v[i] = t;

    	   }

    	}
    	long long a= -1;int ind ;
    	if( n%2 !=0 ){
    	    for( int i= 0 ; i< n; i++){
    	        if( abs(v[i])> a ){

    	            ind= i ;
    	        }
    	    }
    	    v[ind]= -v[ind]-1;
    	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<" ";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< int > v(n) ;

	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;

	}

    	for( int i= 0 ; i <n ; i++) {
    	   if( v[i] >= 0 ){

    	       int t= -v[i]-1;
    	       v[i] = t;

    	   }

    	}
    	int a= -1;int ind ;
    	if( n%2 !=0 ){
    	    for( int i= 0 ; i< n; i++){
    	        if( abs(v[i])> a ){
    	            a= abs(v[i] );
    	            ind= i ;
    	        }
    	    }
    	    v[ind]= -v[ind]-1;
    	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<" ";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< int > v(n) ;

	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;

	}

    	for( int i= 0 ; i <n ; i++) {
    	   if( v[i] >= 0 ){

    	       int t= -v[i]-1;
    	       v[i] = t;

    	   }

    	}
    	int a= -1;int ind ;
    	if( n%2 !=0 ){
    	    for( int i= 0 ; i< n; i++){
    	        if( abs(v[i])> a ){

    	            ind= i ;
    	        }
    	    }
    	    v[ind]= -v[ind]-1;
    	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<" ";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< long long > v(n) ;
	bool flag= false ;
	long long a= 1;
	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;

	    if( v[i]== 0 ){
	        flag= true;
	        break ;

	    }

	}
	long long ans;
	if( flag ==false  ) {

    	bool f = false ;
    	for( int i= 0 ; i <n ; i++) {
    	   if( v[i] > 0 ){

    	       long long t= -v[i]-1;
    	       v[i] = t;
    	       a= a*v[i];
    	   }

    	}
    	ans= a;
    	if( n%2 !=0 ){
    	    for( int i= 0 ; i< n; i++){
    	        long long t= abs(v[i] )-1 ;
    	        a= (a*t)/v[i] ;
    	        if(a> ans ){
    	            ans= a;
    	            v[i] = t;
    	            break;
    	        }
    	    }
    	}
	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<endl;

	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n ;
	cin>>n;
	vector< long long > v(n) ;
	bool flag= false ;
	long long a= 1;
	for( int i = 0; i< n ; i++) {
	    cin>>v[i] ;

	    if( v[i]== 0 ){
	        flag= true;
	        break ;

	    }

	}

	if( flag ==false  ) {

    	bool f = false ;
    	for( int i= 0 ; i <n ; i++) {
    	   if( v[i] > 0 ){

    	       long long t= -v[i]-1;

    	       int k= i ;
    	       i++;
    	       while( i< n) {
    	           if( v[i] >0  ){
    	               f= true ;
    	               long long temp= -v[i] -1;

    	               v[i] = temp;
    	               v[k] = t;
    	               i--;
    	               break;
    	           }
    	           i++;
    	       }

    	   }
    	}
	}
	for( int i= 0 ; i< n; i++) cout<<v[i]<<endl;

	return 0;
}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,h=1,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&((a[i]!=mini) ||(a[i]==mini && f==1)))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;
			if(a[i]==mini)
				h=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(maxi*mini>((-1)*maxi-1)*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&((a[i]!=mini) ||(a[i]==mini && f==1)))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(((-1)*maxi-1)*mini>maxi*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)
{
    // for this example we have taken product
    // of adjacent numbers
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&(a[i]!=mini ||f==1))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&(a[i]!=maxi || g==1))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;

		}
		ppos=accumulate(vpos.begin(), vpos.end(), sum, myfun);
		pneg=accumulate(vneg.begin(), vneg.end(), sum, myfun);
		pneu=accumulate(vneu.begin(), vneu.end(), sum, myfun);
		if(pneu>ppos && pneu>pneg)
			for (ll i = 0; i < n; ++i)cout<<vneu[i]<<" ";
		if(ppos>pneu && ppos>pneg)
			for (ll i = 0; i < n; ++i)cout<<vpos[i]<<" ";
		else
			for (ll i = 0; i < n; ++i)cout<<vneg[i]<<" ";

	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)
{
    // for this example we have taken product
    // of adjacent numbers
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(int i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(int i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (int i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&(a[i]!=mini ||f==1))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (int i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (int i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&(a[i]!=maxi || g==1))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;

		}
		ppos=accumulate(vpos.begin(), vpos.end(), sum, myfun);
		pneg=accumulate(vneg.begin(), vneg.end(), sum, myfun);
		pneu=accumulate(vneu.begin(), vneu.end(), sum, myfun);
		if(pneu>ppos && pneu>pneg)
			for (int i = 0; i < n; ++i)cout<<vneu[i]<<" ";
		if(ppos>pneu && ppos>pneg)
			for (int i = 0; i < n; ++i)cout<<vpos[i]<<" ";
		else
			for (int i = 0; i < n; ++i)cout<<vneg[i]<<" ";

	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,min=10000001,max=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(fabs(a[i])>max){
			max=fabs(a[i]);
			z=i;
			continue;

		}
		else if(fabs(a[i])==max)
		{
			if(a[i]>=1)
				z=i;
		}
	}
	std::vector<ll> vneu(n);
	for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
	if(n%2==0){

		for (int i = 0; i < n; ++i)
		{
			/* code */cout<<vneu[i]<<" ";
		}
	}
	else
	{
		for (int i = 0; i < n; ++i)
		{
			if(i==z && a[i]>=0)
				cout<<a[i]<<" ";
			else if(i==z && a[i]<0)
			cout<<(-1)*a[i]-1<<" ";
			else cout<<vneu[i]<<" ";
		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,h=1,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&((a[i]!=mini) ||(a[i]==mini && f==1)))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;
			if(a[i]==mini)
				h=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(maxi*mini<((-1)*maxi-1)*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
int main()
{
	ll n,mini,maxi,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]<0){
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
		else z++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(int i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(int i=0;i<n;++i)cout<<"-1 ";

		}
	else if((pos+neg+z)%2==1)
	{
		if(-maxi>mini+1)f=1;
		for (int i = 0; i < n; ++i)
		{
			if((a[i]==maxi && f==0)||(a[i]==mini && f==1)||(a[i]!=mini && a[i]>=0 && a[i]!=maxi))
				cout<<-a[i]-1<<" ";
			else if((a[i]==mini && f==0)||(a[i]==maxi && f==1)||(a[i]!=mini && a[i]<0 && a[i]!=maxi))
				cout<<a[i]<<" ";

		}
	}
	else
	{
		for (int i = 0; i < n; ++i)
			{
				if(a[i]>=0)
					cout<<-a[i]-1<<" ";
				else
					cout<<a[i]<<" ";
			}
	}
}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,min=10000001,max=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(fabs(a[i])>max){
			max=fabs(a[i]);
			z=i;
		}
	}
	std::vector<ll> vneu(n);
	for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
	if(n%2==0){

		for (int i = 0; i < n; ++i)
		{
			/* code */cout<<vneu[i]<<" ";
		}
	}
	else
	{
		for (int i = 0; i < n; ++i)
		{
			if(i==z && a[i]>=0)
				cout<<a[i]<<" ";
			else if(i==z && a[i]<0)
			cout<<(-1)*a[i]-1<<" ";
			else cout<<vneu[i]<<" ";
		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&(a[i]!=mini ||f==1))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(((-1)*maxi-1)*mini<maxi*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,min=10000001,max=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(fabs(a[i])>max){
			max=fabs(a[i]);
			z=i;
		}
		else if(fabs(a[i])==max)
		{
			if(a[i]==1)
				z=i;
			if(a[i]<0 && a[i]!=(-1))
				z=i;
		}
	}
	std::vector<ll> vneu(n);
	for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
	if(n%2==0){

		for (int i = 0; i < n; ++i)
		{
			/* code */cout<<vneu[i]<<" ";
		}
	}
	else
	{
		for (int i = 0; i < n; ++i)
		{
			if(i==z && a[i]>=0)
				cout<<a[i]<<" ";
			else if(i==z && a[i]<0)
			cout<<(-1)*a[i]-1<<" ";
			else cout<<vneu[i]<<" ";
		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&((a[i]!=mini) ||(a[i]==mini && f==1)))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(((-1)*maxi-1)*mini<maxi*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}


#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long int ll;
ll myfun(ll x, ll y)  {
    return x * y ;
}
int main()
{
	ll n,mini=10000001,maxi=-10000001,mpos=0,mneg=0,pos=0,neg=0,z=0,f=0;
	cin>>n;
	std::vector<ll> a(n);
	for (ll i = 0; i < n; ++i)
	{
		cin>>a[i];
		if(a[i]>0){
			if(a[i]<mini)mini=a[i];
			pos++;
		}
		else if(a[i]==0 || a[i]==-1){
			 z++;
		}
		else{
			if(a[i]>maxi)maxi=a[i];
			neg++;
		}
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]==maxi)mneg++;
		else if(a[i]==mini)mpos++;
	}
	if(pos==0 && neg==0 )
		{
			if(z%2==1)
			{
				cout<<0<<" ";
				for(ll i=0;i<n-1;++i)
					cout<<"-1 ";
			}
			else for(ll i=0;i<n;++i)cout<<"-1 ";

		}
	else
	{
		ll f=0,g=0,h=1,ppos,pneg,pneu,sum=1;
		std::vector<ll> vpos(n);
		std::vector<ll> vneg(n);
		std::vector<ll> vneu(n);
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0 &&((a[i]!=mini) ||(a[i]==mini && f==1)))
				vpos[i]=(-1)*a[i]-1;
			else
				vpos[i]=a[i];
			if(a[i]==mini)
				f=1;

		}
		for (ll i = 0; i < n; ++i)
		{
			if(a[i]>=0)
				vneu[i]=(-1)*a[i]-1;
			else
				vneu[i]=a[i];

		}
		for (ll i = 0; i < n; ++i)
		{
			if((a[i]>=0 && (a[i]!=mini||(a[i]==mini &&h==1))) ||(a[i]==maxi && g==0))
				vneg[i]=(-1)*a[i]-1;
			else
				vneg[i]=a[i];
			if(a[i]==maxi)
				g=1;
			if(a[i]==mini)
				h=1;

		}
		if((pos+neg+z)%2==0)
			for(ll i=0;i<n;++i)cout<<vneu[i]<<" ";
		else
		{
			if(((-1)*maxi-1)*mini>maxi*((-1)*mini-1))
				for(ll i=0;i<n;++i)cout<<vneg[i]<<" ";
			else
				for(ll i=0;i<n;++i)cout<<vpos[i]<<" ";

		}
	}

}