ship_lengths = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
def is_valid_ship_placement(field, ship_length):
    for i in range(10):
        for j in range(10 - ship_length + 1):
            if all(field[i][j+k] == "#" for k in range(ship_length)):
                for k in range(ship_length):
                    field[i][j+k] = "x"
                return True
    return False
field = [list(input().strip()) for _ in range(10)]
for length in ship_lengths:
    if not is_valid_ship_placement(field, length):
        print("YES")
        break
else:
    for row in field:
        if "#" in row:
            print("NO")
            break
    else:
        print("YES")
