def check_battleship_placement(field):
    ship_counts = {4: 1, 3: 2, 2: 3, 1: 4}
    
    if sum(row.count('#') for row in field) != 20:
        return "NO"
    
    for row in range(10):
        for col in range(10):
            if field[row][col] == '#':
                if (row == 0 or field[row-1][col] == '.') and (row == 9 or field[row+1][col] == '.') and \
                   (col == 0 or field[row][col-1] == '.') and (col == 9 or field[row][col+1] == '.'):
                    return "NO"
    
    for size, count in ship_counts.items():
        if sum(row.count('#') for row in field) != size * count:
            return "NO"
    
    for row in range(10):
        for col in range(10):
            if field[row][col] == '#':
                if (row+1 < 10 and field[row+1][col] == '#') or (col+1 < 10 and field[row][col+1] == '#'):
                    return "NO"
    
    for row in range(9):
        for col in range(9):
            if field[row][col] == '#' and field[row+1][col+1] == '#':
                return "NO"
    
    return "YES"

field = []
for _ in range(10):
    row = input().strip()
    field.append(row)

print(check_battleship_placement(field))