def check_battleship_placement(field):
    ship_counts = {'four': 0, 'three': 0, 'two': 0, 'one': 0}

    for row in field:
        for cell in row:
            if cell == '#':
                if (row.count('#') > 4 or field.count('#') > 20):
                    return 'NO'
                if row.count('#') == 4:
                    ship_counts['four'] += 1
                elif row.count('#') == 3:
                    ship_counts['three'] += 1
                elif row.count('#') == 2:
                    ship_counts['two'] += 1
                elif row.count('#') == 1:
                    ship_counts['one'] += 1

    if ship_counts != {'four': 1, 'three': 2, 'two': 3, 'one': 4}:
        return 'NO'

    for i in range(len(field)):
        for j in range(len(field[i])):
            if field[i][j] == '#':
                if i > 0 and field[i-1][j] == '#' or \
                    i < len(field)-1 and field[i+1][j] == '#' or \
                    j > 0 and field[i][j-1] == '#' or \
                    j < len(field[i])-1 and field[i][j+1] == '#':
                    return 'NO'

    return 'YES'

input_field = []
for _ in range(10):
    input_field.append(input())

result = check_battleship_placement(input_field)
print(result)
