def morskoi_boi(field):
    ship_counts = {
        'Battleship': 0,
        'Cruisers': 0,
        'Destroyers': 0,
        'Submarines': 0
    }

    def is_inside(x, y):
        return 0 <= x < 10 and 0 <= y < 10

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                if (
                    (i == 9 or field[i + 1][j] == '.') and
                    (j == 9 or field[i][j + 1] == '.') and
                    (is_inside(i, j - 1) and field[i][j - 1] != '#' or not is_inside(i, j - 1)) and
                    (is_inside(i - 1, j) and field[i - 1][j] != '#' or not is_inside(i - 1, j))
                ):
                   
                    ship_counts['Battleship'] += 1
                else:
                
                    if is_inside(i + 1, j) and field[i + 1][j] == '#':
                        ship_counts['Cruisers'] += 1
                    elif is_inside(i, j + 1) and field[i][j + 1] == '#':
                        ship_counts['Cruisers'] += 1
                    elif is_inside(i + 1, j) and field[i + 1][j] == '#':
                        ship_counts['Destroyers'] += 1
                    elif is_inside(i, j + 1) and field[i][j + 1] == '#':
                        ship_counts['Destroyers'] += 1
                    else:
                        ship_counts['Submarines'] += 1

    if (
        ship_counts['Battleship'] == 1 and
        ship_counts['Cruisers'] == 2 and
        ship_counts['Destroyers'] == 3 and
        ship_counts['Submarines'] == 4
    ):
        return "YES"
    else:
        return "NO"


field = [input() for _ in range(10)]

result = morskoi_boi(field)
print(result)
# Пишем код сюда
