def check_battleship_field(field):
    counts = [0] * 5
    dx = [0, 1, 0, -1]
    dy = [-1, 0, 1, 0]

    for y in range(10):
        for x in range(10):
            if field[y][x] == "#":
                ship_size = 0

                for d in range(4):
                    new_x, new_y = x + dx[d], y + dy[d]
                    if 0 <= new_x < 10 and 0 <= new_y < 10 and field[new_y][new_x] == "#":
                        ship_size += 1

                counts[ship_size] += 1

    return counts == [0, 4, 3, 2, 1]

field = [input() for _ in range(10)]
result = check_battleship_field(field)
if result:
    print("YES")
else:
    print("NO")
