import Data.List
import qualified Data.Map as M

main = do
  [n,k] <- map read.words <$> getLine :: IO [Int]
  as    <- map read.words <$> getLine :: IO [Int]
  let ds = M.fromList $ zip [1..] $ map ((k+1)-) as
  putStr $ solve n k ds [] 0

solve :: Int -> Int -> M.Map Int Int -> [Int] -> Int -> String
solve n k ds acc step
  | step == k && able = show (n+k*(n-1)) ++ "\n" ++ unwords ( map show (ans n k acc 0) )
  | step == k && not able = "-1"
  | otherwise = solve n k (M.insert mk (mv-1) ds) (mk:acc) (step+1)
  where
  able = M.null $ M.filter (>0) ds
  p = if null acc then 0 else head acc
  (mk,mv) = M.foldlWithKey (\(mk,mv) k v -> if v > mv && k /= p then (k,v) else (mk,mv) ) (0,-100) ds
  ans n k (a:as) 0 = [ i | i <- [1..n], i /= a ] ++ a : ans n k (a:as) 1
  ans n k [a] _    = [ i | i <- [1..n], i /= a ]
  ans n k (a:b:as) step = [ i | i <- [1..n], i /= a, i /= b ] ++ b : ans n k (b:as) (step+1)
