def check_ship_placement(field):
    ship_counts = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                ship_counts[len(field[i][j+1:]) - field[i][j+1:].find('#')] -= 1

    return all(count == 0 for count in ship_counts)

# Check if the ship placement is valid
result = check_ship_placement(field)

# Print the result
if result:
    print("YES")
else:
    print("NO")

