def solve():
    n = 10
    A = [[0 for i in range(n+2)] for j in range(n+2)]
    NO = 0
    for i in range(n):
        s = list(input())
        for j in range(n):
            if s[j] == "#":
                A[i+1][j+1] = 1

    for i in range(1, n+1):
        for j in range(1, n+1):
            if A[i][j]:
                if A[i-1][j-1] or A[i-1][j+1] or A[i+1][j-1] or A[i+1][j+1]:
                    NO = 1

    if NO:
        print("NO")
        exit()



    ships = {"4": 0 , "3":0, "2":0, "1":0}
    normal_ships = {"4": 1, "3":2, "2":3, "1": 4}
    moves = [+1, -1]
    for i in range(n+1):
        for j in range(n+1):
            horizontal = 0
            vertical = 0
            if A[i][j]:
                if A[i][j+1] or A[i][j-1]:
                    horizontal = 1
                elif A[i-1][j] or A[i+1][j]:
                    vertical = 1
                ship_lenght = 1
                if horizontal:
                    if A[i][j+1]:
                        while A[i][j+ship_lenght]:
                            ship_lenght += 1
                        A[i][j: j+ship_lenght] = [0 for k in range(ship_lenght)]
                    else:
                        while A[i][j-ship_lenght]:
                            ship_lenght += 1
                        A[i][j-ship_lenght: j] = [0 for k in range(ship_lenght)]
                elif vertical:
                    if A[i+1][j]:
                        while A[i+ship_lenght][j]:
                            ship_lenght += 1
                        for k in range(ship_lenght):
                            A[i+k][j] = 0
                    else:
                        while A[i-ship_lenght][j]:
                            ship_lenght += 1
                        for k in range(ship_lenght):
                            A[i-k][j] = 0
                else:
                    ship_lenght = 1
                    A[i][j] = 0
                ships[str(ship_lenght)] += 1


    for i in range(1, 4):
        if ships[str(i)] != normal_ships[str(i)]:
            print("NO")

    print("YES")

solve()