object Main {
	def main(A:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n,k=s.nextInt
		val a=(0 to n-1).map(i=>s.nextInt)
		if(a.count(i=>i>=k+1)+math.min(1,a.count(i=>i==k))<n)
			println(-1)
		else{
			println(n*(k+1)-1)
			val m=(1 to n).minBy(i=>a(i-1))
			val t = (1 to n).filterNot(i=>i==m).mkString(" ")
			val u=s"${t} ${m} "
			for(_<-1 to k)
				print(u)
			println(t)
		}
	}
}