m = [0] * 10
for i in range(10):
    m[i] = [char for char in input()]
correct = True
cnt = [0] * 4
direct = "none"

for i in range(10):
    for j in range(10):
        direct = "none"
        if m[i][j] == "#":
            if i != 9 and j != 0:  # Нижний левый
                if m[i + 1][j - 1] == "#":
                    correct = False
                    break
            if i != 9 and j != 9:  # Нижний правый
                if m[i + 1][j + 1] == "#":
                    correct = False
                    break
            if i != 9:  # Снизу
                if m[i + 1][j] == "#":
                    direct = "down"
            if j != 9:  # Справа
                if m[i][j + 1] == "#":
                    direct = "right"
            if direct == "none":
                cnt[0] += 1
            if direct == "down":
                c = 0
                while i + c + 1 <= 9 and m[i + c + 1][j] == "#":

                    c += 1
                    m[i + c][j] = '.'
                    if i + c != 9 and j != 0:  # Нижний левый
                        if m[i + c + 1][j - 1] == "#":
                            correct = False
                            break
                    if i + c != 9 and j != 9:  # Нижний правый
                        if m[i + c + 1][j + 1] == "#":
                            correct = False
                            break
                cnt[c] += 1
            elif direct == "right":
                c = 0
                while j + c + 1 <= 9 and m[i][j + c + 1] == "#":

                    c += 1
                    m[i][j + c] = '.'
                    if i != 9 and j != 9:  # Нижний левый
                        if m[i + 1][j + c - 1] == "#":
                            correct = False
                            break
                    if i != 9 and j + c != 9:  # Нижний правый
                        if m[i + 1][j + c + 1] == "#":
                            correct = False
                            break

                cnt[c] += 1

    if not correct:
        break

if not correct or cnt[0] != 4 or cnt[1] != 3 or cnt[2] != 2 or cnt[3] != 1:
    print("NO")
else:
    print("YES")