Time limit
2s
Memory limit
128 MB
Six unit squares joined edge to edge may form a net of a cube. A net is a shape that can be folded along its shared edges to make exactly one cube.
The shape in the first illustration can be folded into a cube.

The next shape also consists of six connected unit squares, but it cannot be folded into a cube.

Given a shape made of six unit squares, write a program that determines whether it is a net of a cube.
Three data sets are given. Each data set consists of 6 lines, and each line contains 6 numbers separated by spaces. Every number is either 0 or 1.
A 1 represents a square, and a 0 represents an empty cell. In each data set, exactly six cells are 1, and the squares form one connected shape.
For the three data sets, output one line per data set in the same order as the input. Print yes if the shape is a net of a cube, and no otherwise.