#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
   
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("fast-loops")
// #pragma GCC optimize("-funsafe-loop-optimizations")
// #pragma GCC optimize("-funroll-loops")
// #pragma GCC optimize("-fwhole-program")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC optimize("-fthread-jumps")
// #pragma GCC optimize("-falign-functions")
// #pragma GCC optimize("-falign-jumps")
// #pragma GCC optimize("-falign-loops")
// #pragma GCC optimize("-falign-labels")
// #pragma GCC optimize("-fcaller-saves")
// #pragma GCC optimize("-fcrossjumping")
// #pragma GCC optimize("-fcse-follow-jumps")
// #pragma GCC optimize("-fcse-skip-blocks")
// #pragma GCC optimize("-fdelete-null-pointer-checks")
// #pragma GCC optimi™ze("-fdevirtualize")
// #pragma GCC optimize("-fexpensive-optimizations")
// #pragma GCC optimize("-fgcse")
// #pragma GCC optimize("-fgcse-lm")
// #pragma GCC optimize("-fhoist-adjacent-loads")
// #pragma GCC optimize("-finline-small-functions")
// #pragma GCC optimize("-findirect-inlining")
// #pragma GCC optimize("-fipa-sra")
// #pragma GCC optimize("-foptimize-sibling-calls")
// #pragma GCC optimize("-fpartial-inlining")
// #pragma GCC optimize("-fpeephole2")
// #pragma GCC optimize("-freorder-blocks")
// #pragma GCC optimize("-freorder-functions")
// #pragma GCC optimize("-frerun-cse-after-loop")
// #pragma GCC optimize("-fsched-interblock")
// #pragma GCC optimize("-fsched-spec")
// #pragma GCC optimize("-fschedule-insns")
// #pragma GCC optimize("-fschedule-insns2")
// #pragma GCC optimize("-fstrict-aliasing")
// #pragma GCC optimize("-fstrict-overflow")
// #pragma GCC optimize("-ftree-switch-conversion")
// #pragma GCC optimize("-ftree-tail-merge")
// #pragma GCC optimize("-ftree-pre")
// #pragma GCC optimize("-ftree-vrp")
// #pragma GCC target("avx") 
   
   
using namespace std;
   
//#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fast() ios_base::sync_with_stdio(0),cin.tie(0)
// #define int long long
#define sq (x) ((x) * (x))
#define cube (x) ((x) * (x) * (x))
//
double dis(int x1 , int y1 , int x2 , int y2){return sqrt(pow(abs(x1 - x2) , 2) + pow(abs(y1 - y2) , 2));}
double ddis(double x1 , double y1 , double x2 , double y2){return sqrt(pow(abs(x1 - x2) , 2) + pow(abs(y1 - y2) , 2));}
int gcd (int a, int b) {if (b == 0){return a;}else {return gcd (b, a % b);}}
void pre(int a) { cout<<fixed<<setprecision(a); }

int bitcount (int x) {return __builtin_popcount  (x);}
int lcm (int a, int b) {return a / gcd(a, b) * b;}
int llmin(int x , int y){if (x >= y){return y;}else {return x;}}
int llmax(int x , int y){if (x >= y){return x;}else {return y;}}
//
const int N = 2e5 + 17;
const long long INF = 1e18 + 1;
const int modd = 1e9 + 7;
const int P = 31;
const double eps = 1e-19;
long double pi = 3.1415926535897323;
using namespace std;
char a[11][11];
int used[11][11];
int dp[11][11];
int pd[11][11];
int chu(int i , int j){
  int sum = 0;
  if (a[i][j] == '#' && used[i][j] == 0)sum++;
  else return sum;
  if (a[i-1][j] == '#' && used[i-1][j] == 0 && (i-1) >= 1)sum++;
  else return sum;
  if (a[i-2][j] == '#' && used[i-2][j] == 0 && (i-2) >= 1)sum++;
  else return sum;
  if (a[i-3][j] == '#' && used[i-3][j] == 0 && (i-3) >= 1)sum++;
  else return sum;
  return sum;
}
int chd(int i , int j){
  int sum = 0;
  if (a[i][j] == '#' && used[i][j] == 0)sum++;
  else return sum;
  if (a[i+1][j] == '#' && used[i+1][j] == 0 && (i+1) <= 10)sum++;
  else return sum;
  if (a[i+2][j] == '#' && used[i+2][j] == 0 && (i+2) >= 10)sum++;
  else return sum;
  if (a[i+3][j] == '#' && used[i+3][j] == 0 && (i+3) >= 10)sum++;
  else return sum;
  return sum;
}
int chl(int i , int j){
  int sum = 0;
  if (a[i][j] == '#' && used[i][j] == 0)sum++;
  else return sum;
  if (a[i][j-1] == '#' && used[i][j-1] == 0 && (j-1) >= 1)sum++;
  else return sum;
  if (a[i][j-2] == '#' && used[i][j-2] == 0 && (j-2) >= 1)sum++;
  else return sum;
  if (a[i][j-3] == '#' && used[i][j-3] == 0 && (j-3) >= 1)sum++;
  else return sum;
  return sum;
}
int chr(int i , int j){
  int sum = 0;
  if (a[i][j] == '#' && used[i][j] == 0)sum++;
  else return sum;
  if (a[i][j+1] == '#' && used[i][j+1] == 0 && (j+1) <= 10)sum++;
  else return sum;
  if (a[i][j+2] == '#' && used[i][j+2] == 0 && (j+2) <= 10)sum++;
  else return sum;
  if (a[i][j+3] == '#' && used[i][j+3] == 0 && (j+3) <= 10)sum++;
  else return sum;
  return sum;
}
int c[5];
void PON(){
  int n = 10 , m = 10;
  for (int i = 1 ; i <= n ; i ++){
    for (int j = 1 ; j <= m ; j ++){
      cin >> a[i][j];
    }
  }
  for (int i = 1 ; i <= n ; i ++){
    for (int j = 1 ; j <= m ; j ++){
      if (a[i][j] == '#'){
        dp[i][j] = dp[i][j-1] + 1;
      }
      else {
        if (dp[i][j-1] > 4){
          cout << "NO" << endl;
          return;
        }
        if (a[i-1][j-1] != '#' && a[i+1][j-1] != '#')c[dp[i][j-1]]++;
        dp[i][j] = 0;
      }
    }
  }
  for (int j = 1 ; j <= n ; j ++){
    for (int i = 1 ; i <= m ; i ++){
      if (a[i][j] == '#'){
        pd[i][j] = pd[i-1][j] + 1;
      }else {
        if (pd[i-1][j] > 4){
          cout << "NO" << endl;
          return;
        }
        if (pd[i-1][j] > 1)c[pd[i-1][j]]++;
        pd[i][j] = 0;
      }
    }
  }
  if (c[4] == 1 && c[3] == 2 && c[2] == 3 && c[1] == 4)cout << "YES" << endl;
  else cout << "NO" << endl;
}
signed main () {
  fast();
  // freopen("matrix2.in", "r", stdin);
  // freopen("matrix2.out", "w", stdout);
    // int T;
    // cin >> T;
    // while (T--){
        PON();
    // }
}