import sys


warships = [4, 3, 2, 1]

def check_warship(pole, indices):
    y0, x0 = indices
    all_indices = [(y0, x0)]
    
    try:
        for x in range(indices[1] + 1, 10):
            if pole[y0][x] == ".":
                break
            all_indices.append((y0, x))
    except IndexError:
        pass

    if len(all_indices) == 1:
        try:
            for y in range(indices[0] + 1, 10):
                if pole[y][x0] == ".":
                    break
                all_indices.append((y, x0))
        except IndexError:
            pass

    return all_indices


pole = sys.stdin.readlines()
for index, item in enumerate(pole):
    pole[index] = list(item.strip())

checked_dict = {
    (x, y): False for x in range(10) for y in range(10)
}

warships_indices = []

try:
    for y in range(10):
        for x in range(10):
            if pole[y][x] == "#" and not checked_dict[(y, x)]:
                all_indices = check_warship(pole, (y, x))
                warships[len(all_indices) - 1] -= 1
                for y1, x1 in all_indices:
                    warships_indices.append((y1, x1))
                    checked_dict[(y1, x1)] = True
                    checked_dict[(y1 + 1, x1)] = True
                    checked_dict[(y1 - 1, x1)] = True
                    checked_dict[(y1, x1 + 1)] = True
                    checked_dict[(y1, x1 - 1)] = True
                    checked_dict[(y1 + 1, x1 + 1)] = True
                    checked_dict[(y1 + 1, x1 - 1)] = True
                    checked_dict[(y1 - 1, x1 + 1)] = True
                    checked_dict[(y1 - 1, x1 - 1)] = True
            if pole[y][x] == "#" and (y, x) not in warships_indices and checked_dict[(y, x)]:
                print("NO")
                exit()
except IndexError:
    print("NO")
    exit()

print("YES" if not any(warships) else "NO")

