#include <bits/stdc++.h>

using namespace std;

long long a[100000000];

int main()
{
	int n,k;
	cin>>n>>k;
	int r = 0;
	queue<int> q;
	for(int i =0;i<n;i++)
	{
		int c;
		cin>>c;
		if(c == 0)
		{
			a[0]++;
			continue;
		}
		if(c<0)
		{
			a[(2*c-1)]++;
			continue;
		}
		a[2*c]++;
	}
	for(int i = 0;i<2*n+3;i++)
	{
		if(a[i]>=k)
		{
			r++;
			if(a[i] % 2 == 0)
			{
				q.push(i/2);
			}
			else
			{
				q.push(((-1)*i+1)/2);
			}
		}
	}
	cout<<r<<endl;
	while(q.empty())
	{
		cout<<q.front();
		q.pop();
	}
}