#include <iostream>
#include <vector>
#define endl '\n'
using namespace std;

int n, k;
int m[2000005];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n >> k;
	vector<int> res;
	int counter = 0;
	for (int i = 0; i < n; i++)
	{
		int curr; cin >> curr;
		if (curr < 0) curr = 1000000 - curr;
		m[curr]++;
	}
	for (int i = 0; i < 2000006; i++)
	{
		if (m[i] >= 2)
		{
			counter++;
			if (i < 1000001) res.push_back(i);
			else res.push_back(-(i - 1000000));
		}
	}
	cout << counter << endl;
	for (int i = 0; i < res.size(); i++)
		cout << res[i] << " ";
}