CF509B Painting Pebbles

Description

There are $ n $ piles of pebbles on the table, the $ i $ -th pile contains $ a_{i} $ pebbles. Your task is to paint each pebble using one of the $ k $ given colors so that for each color $ c $ and any two piles $ i $ and $ j $ the difference between the number of pebbles of color $ c $ in pile $ i $ and number of pebbles of color $ c $ in pile $ j $ is at most one. In other words, let's say that $ b_{i,c} $ is the number of pebbles of color $ c $ in the $ i $ -th pile. Then for any $ 1

Input Format

The first line of the input contains positive integers $ n $ and $ k $ ( $ 1

Output Format

If there is no way to paint the pebbles satisfying the given condition, output "NO" (without quotes) . Otherwise in the first line output "YES" (without quotes). Then $ n $ lines should follow, the $ i $ -th of them should contain $ a_{i} $ space-separated integers. $ j $ -th ( $ 1