w = 'YES'
q = [input() for i in range(10)]
s = [[] for i in range(10)]
for i in range(10):
    for j in q[i]:
        s[i].append(j)
for i in range(10):
    s[i].insert(0,'.')
    s[i].insert(11,'.')
s.insert(0,['.' for i in range(12)])
s.insert(11,['.' for i in range(12)])
for i in range(1,11):
    for j in range(1,11):
        if s[i][j] == '#':
            if s[i-1][j-1] == '#' or s[i-1][j+1] == '#' or s[i+1][j-1] == '#' or s[i+1][j+1] == '#':
                w = 'NO'
print(w)