AdvancedRating 1500
Valid Sudoku Board
Check a partly filled 9×9 Sudoku (. = empty): no digit repeats in any row, column or 3×3 box. Print YES or NO.
Input
Nine lines of 9 characters.
Output
YES or NO.
Sample 1
Input
53..7.... 6..195... .98....6. 8...6...3 4..8.3..1 7...2...6 .6....28. ...419..5 ....8..79
Output
YES
Sample 2
Input
83..7.... 6..195... .98....6. 8...6...3 4..8.3..1 7...2...6 .6....28. ...419..5 ....8..79
Output
NO
Output appears here