def is_valid_battleship_field(field):

    count_hashes = sum(row.count('#') for row in field)

    if count_hashes != 20:
        return "NO"
    sizes = [4, 3, 3, 2, 2, 1, 1, 1, 1]
    for size in sizes:
        found = False
        for i in range(10):
            for j in range(10):
                if field[i][j] == '#':
                    if (j + size <= 10 and all(field[i][j + k] == '#' for k in range(size))) or \
                       (i + size <= 10 and all(field[i + k][j] == '#' for k in range(size))):
                        found = True
                        break
            if found:
                break
        if not found:
            return "NO"
    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                if (i > 0 and field[i - 1][j] == '#') or \
                   (i < 9 and field[i + 1][j] == '#') or \
                   (j > 0 and field[i][j - 1] == '#') or \
                   (j < 9 and field[i][j + 1] == '#'):
                    return "NO"
    
    return "YES"
field = []
for _ in range(10):
    row = input().strip()
    field.append(row)
result = is_valid_battleship_field(field)
print(result)
