#include <stdio.h>
#include <vector>

using namespace std;

int main()
{
    vector <long long> a,b,c;
    long long n,k,br=0;
    scanf("%lld%lld",&n,&k);
    for (long long i=0;i<=n;i++)
    {
      a.push_back(0);
      b.push_back(0);
    }
    for (long long i=0;i<n;i++)
    {
      long long d;
      scanf("%lld",&d);
      if (d<0)
      {
        d*=-1;
        b[d]++;
      }
      else
      {
        a[d]++;
      }
    }
    for (long long i=0;i<=n;i++)
    {
      if (a[i]>=k)
      {
        br++;
        c.push_back(i);
      }
      if (b[i]>=k)
      {
        br++;
        c.push_back(-i);
      }
    }
    printf("%lld\n",br);
    for (long long i=0;i<br;i++)
    {
      printf("%lld ",c[i]);
    }
}