#include<bits/stdc++.h>
using namespace std;
long long n,i,k,l,a[100010],x,b[100010],broj;
main()
{
	ios_base::sync_with_stdio(0);
    cin>>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>x;
	if(x<0)
	{
	x*=-1;
	b[x]++;	
    }
    
    else
    a[x]++;
	}
	
for(i=1;i<=n;i++)
	if(b[i]>=k)
	broj++;

for(i=0;i<=n;i++)
	if(a[i]>=k)
	broj++;

cout<<broj<<endl;

for(i=n;i>=1;i--)
if(b[i]>=k)
cout<<-1*i<<" ";

for(i=0;i<=n;i++)
if(a[i]>=k)
cout<<i<<" ";

return 0;
}