#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define test int _; cin >> _; while (_--)
#define mod 1000000007
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
char a[10][10];
bool horizontal(){
int res=0;
for(int i=0;i<10;i++){
int cnt=0;
for(int j=0;j<10;j++){
if(a[i][j]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
}
res = max(res,cnt);
}
return res>=5;
}
bool vertical(){
int res=0;
for(int i=0;i<10;i++){
int cnt=0;
for(int j=0;j<10;j++){
if(a[j][i]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
}
res = max(res,cnt);
}
return res>=5;
}
bool diagonal(){
int res=0;
for (int row = 0; row < 10; row++) {
int col = 0,cnt=0;
while (row < 10 && col < 10) {
if(a[row][col]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
row++;
col++;
}
res = max(res,cnt);
}
for (int col = 1; col < 10; col++) {
int row = 0,cnt=0;
while (row < 10 && col < 10) {
if(a[row][col]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
row++;
col++;
}
res = max(res,cnt);
}
for (int row = 0; row < 10; row++) {
int col = 9,cnt=0;
while (row < 10 && col >= 0) {
if(a[row][col]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
row++;
col--;
}
res = max(res,cnt);
}
for (int col = 8; col >= 0; col--) {
int row = 0,cnt=0;
while (row < 10 && col >= 0) {
if(a[row][col]=='X') cnt++;
else{
res = max(res,cnt);
cnt=0;
}
row++;
col--;
}
res = max(res,cnt);
}
return res>=5;
}
signed main() {
fast
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
cin>>a[i][j];
}
}
bool f=0;
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(a[i][j]=='.'){
a[i][j] = 'X';
if(vertical()||horizontal()||diagonal()){
f=1;
break;
}
a[i][j] = '.';
}
}
if(f) break;
}
cout<< (f?"YES":"NO");
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIGVuZGwgJ1xuJwojZGVmaW5lIHRlc3QgaW50IF87IGNpbiA+PiBfOyB3aGlsZSAoXy0tKQojZGVmaW5lIG1vZCAxMDAwMDAwMDA3CiNkZWZpbmUgZmFzdCBpb3M6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7Y2luLnRpZSgwKTtjb3V0LnRpZSgwKTsKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjaGFyIGFbMTBdWzEwXTsKYm9vbCBob3Jpem9udGFsKCl7CiAgICBpbnQgcmVzPTA7CiAgICBmb3IoaW50IGk9MDtpPDEwO2krKyl7CiAgICAgICAgaW50IGNudD0wOwogICAgICAgIGZvcihpbnQgaj0wO2o8MTA7aisrKXsKICAgICAgICAgICAgaWYoYVtpXVtqXT09J1gnKSBjbnQrKzsKICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgIHJlcyA9IG1heChyZXMsY250KTsKICAgICAgICAgICAgICAgIGNudD0wOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJlcyA9IG1heChyZXMsY250KTsKICAgIH0KICAgIHJldHVybiByZXM+PTU7Cn0KYm9vbCB2ZXJ0aWNhbCgpewogICAgaW50IHJlcz0wOwogICAgZm9yKGludCBpPTA7aTwxMDtpKyspewogICAgICAgIGludCBjbnQ9MDsKICAgICAgICBmb3IoaW50IGo9MDtqPDEwO2orKyl7CiAgICAgICAgICAgIGlmKGFbal1baV09PSdYJykgY250Kys7CiAgICAgICAgICAgIGVsc2V7CiAgICAgICAgICAgICAgICByZXMgPSBtYXgocmVzLGNudCk7CiAgICAgICAgICAgICAgICBjbnQ9MDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXMgPSBtYXgocmVzLGNudCk7CiAgICB9CiAgICByZXR1cm4gcmVzPj01Owp9CmJvb2wgZGlhZ29uYWwoKXsKICAgIGludCByZXM9MDsKICAgIGZvciAoaW50IHJvdyA9IDA7IHJvdyA8IDEwOyByb3crKykgewogICAgICAgIGludCBjb2wgPSAwLGNudD0wOwogICAgICAgIHdoaWxlIChyb3cgPCAxMCAmJiBjb2wgPCAxMCkgewogICAgICAgICAgICBpZihhW3Jvd11bY29sXT09J1gnKSBjbnQrKzsKICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgIHJlcyA9IG1heChyZXMsY250KTsKICAgICAgICAgICAgICAgIGNudD0wOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJvdysrOwogICAgICAgICAgICBjb2wrKzsKICAgICAgICB9CiAgICAgICAgcmVzID0gbWF4KHJlcyxjbnQpOwogICAgfQogICAgZm9yIChpbnQgY29sID0gMTsgY29sIDwgMTA7IGNvbCsrKSB7CiAgICAgICAgaW50IHJvdyA9IDAsY250PTA7CiAgICAgICAgd2hpbGUgKHJvdyA8IDEwICYmIGNvbCA8IDEwKSB7CiAgICAgICAgICAgIGlmKGFbcm93XVtjb2xdPT0nWCcpIGNudCsrOwogICAgICAgICAgICBlbHNlewogICAgICAgICAgICAgICAgcmVzID0gbWF4KHJlcyxjbnQpOwogICAgICAgICAgICAgICAgY250PTA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcm93Kys7CiAgICAgICAgICAgIGNvbCsrOwogICAgICAgIH0KICAgICAgICByZXMgPSBtYXgocmVzLGNudCk7CiAgICB9CgogICAgZm9yIChpbnQgcm93ID0gMDsgcm93IDwgMTA7IHJvdysrKSB7CiAgICAgICAgaW50IGNvbCA9IDksY250PTA7CiAgICAgICAgd2hpbGUgKHJvdyA8IDEwICYmIGNvbCA+PSAwKSB7CiAgICAgICAgICAgIGlmKGFbcm93XVtjb2xdPT0nWCcpIGNudCsrOwogICAgICAgICAgICBlbHNlewogICAgICAgICAgICAgICAgcmVzID0gbWF4KHJlcyxjbnQpOwogICAgICAgICAgICAgICAgY250PTA7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcm93Kys7CiAgICAgICAgICAgIGNvbC0tOwogICAgICAgIH0KICAgICAgICByZXMgPSBtYXgocmVzLGNudCk7CiAgICB9CiAgICBmb3IgKGludCBjb2wgPSA4OyBjb2wgPj0gMDsgY29sLS0pIHsKICAgICAgICBpbnQgcm93ID0gMCxjbnQ9MDsKICAgICAgICB3aGlsZSAocm93IDwgMTAgJiYgY29sID49IDApIHsKICAgICAgICAgICAgaWYoYVtyb3ddW2NvbF09PSdYJykgY250Kys7CiAgICAgICAgICAgIGVsc2V7CiAgICAgICAgICAgICAgICByZXMgPSBtYXgocmVzLGNudCk7CiAgICAgICAgICAgICAgICBjbnQ9MDsKICAgICAgICAgICAgfQogICAgICAgICAgICByb3crKzsKICAgICAgICAgICAgY29sLS07CiAgICAgICAgfQogICAgICAgIHJlcyA9IG1heChyZXMsY250KTsKICAgIH0KICAgIHJldHVybiByZXM+PTU7Cn0KCnNpZ25lZCBtYWluKCkgewogICAgZmFzdAogICAgZm9yKGludCBpPTA7aTwxMDtpKyspewogICAgICAgIGZvcihpbnQgaj0wO2o8MTA7aisrKXsKICAgICAgICAgICAgY2luPj5hW2ldW2pdOwogICAgICAgIH0KICAgIH0KICAgIGJvb2wgZj0wOwogICAgZm9yKGludCBpPTA7aTwxMDtpKyspewogICAgICAgIGZvcihpbnQgaj0wO2o8MTA7aisrKXsKICAgICAgICAgICAgaWYoYVtpXVtqXT09Jy4nKXsKICAgICAgICAgICAgICAgIGFbaV1bal0gPSAnWCc7CiAgICAgICAgICAgICAgICBpZih2ZXJ0aWNhbCgpfHxob3Jpem9udGFsKCl8fGRpYWdvbmFsKCkpewogICAgICAgICAgICAgICAgICAgIGY9MTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGFbaV1bal0gPSAnLic7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYoZikgYnJlYWs7CiAgICB9CiAgICBjb3V0PDwgKGY/IllFUyI6Ik5PIik7Cn0=