
def solve():
    matrix = []

    for i in range(10):
        matrix.append(input())

    black_list = []

    ships = [0, 0, 0, 0]

    for i in range(10):
        for j in range(10):

            if [i, j] in black_list:
                continue

            if matrix[i][j] == "#":

                # corners
                try:
                    black_list.append([i - 1, j - 1])
                    if matrix[i-1][j-1] == "#" and i-1 >= 0 and j-1 >= 0:
                        return "NO"

                except IndexError:
                    pass

                try:
                    black_list.append([i - 1, j + 1])
                    if matrix[i-1][j+1] == "#" and i-1 >= 0:
                        return "NO"

                except IndexError:
                    pass

                try:
                    black_list.append([i + 1, j - 1])
                    if matrix[i+1][j-1] == "#" and j-1 >= 0:
                        return "NO"

                except IndexError:
                    pass

                try:
                    black_list.append([i + 1, j + 1])
                    if matrix[i+1][j+1] == "#":
                        return "NO"

                except IndexError:
                    pass

                # sides
                # up
                up = 0
                for a in range(1, 6):

                    if i - a < 0:
                        break

                    black_list.append([i - a, j])

                    if matrix[i - a][j] == "#":
                        up += 1
                    else:
                        break

                # down
                down = 0
                for a in range(1, 6):

                    if i + a >= 10:
                        break

                    black_list.append([i + a, j])

                    if matrix[i + a][j] == "#":
                        down += 1
                    else:
                        break

                # left
                left = 0
                for a in range(1, 6):

                    if j - a < 0:
                        break

                    black_list.append([i, j - a])

                    if matrix[i][j - a] == "#":
                        left += 1
                    else:
                        break

                # right
                right = 0
                for a in range(1, 6):

                    if j + a >= 10:
                        break

                    black_list.append([i, j + a])

                    if matrix[i][j + a] == "#":
                        right += 1
                    else:
                        break

                ships[max([left, right, up, down])] += 1

    if ships != [4, 3, 2, 1]:
        return "NO"

    return "YES"


print(solve())
