// Created by CAD on 2019/8/6.
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f
#define PII pair<int,int>
#define PIII pair<pair<int,int>,int>
#define mst(name, value) memset(name,value,sizeof(name))
#define FOPEN freopen("C:\\Users\\14016\\Desktop\\cad.txt","r",stdin)
#define test(n) cout<<n<<endl
using namespace std;
int dir_x[] = {0, 1, 1, 1, 0, 0, -1, -1, -1};
int dir_y[] = {0, 0, 1, -1, 1, -1, 1, 0, -1};
char g[11][11];
bool check(int a,int b)
{
for (int i = 1; i <= 10; ++i)
for (int j = 1; j <= 10; ++j)
for (int k = 1; k <= 8; ++k)
{
bool flag = true;
for (int t = 0; t <= 4; t++)
{
int x = i + dir_x[k] * t;
int y = j + dir_y[k] * t;
if (x >= 1 && x <= 10 && y >= 1 && y <= 10 && g[x][y] == 'X'){}
else
flag = false;
}
if (flag) return true;
}
return false;
}
int main()
{
for (int i = 1; i <= 10; i++)
scanf("%s", g[i]+1);
for (int i = 1; i <= 10; i++)
{
for (int j = 1; j <= 10; j++)
{
if (g[i][j] == '.')
{
g[i][j] = 'X';
if (check(i,j))
return puts("YES");
g[i][j] = '.';
}
}
}
cout << "NO" << endl;
}