#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int a[1005], b[1005], c[1005];
int main()
{
int n, m, number = 0;
while(scanf("%d%d", &n, &m) != EOF)
{
++number;
int ans = 0;
memset(c, 0, sizeof(c));
for(int i = 0;i < n;++i)
scanf("%d", &a[i]);
for(int i = 0;i < m;++i)
scanf("%d", &b[i]);
sort(a, a + n);
for(int i = 0;i < m;++i)
{
for(int j = n - 1;j >= 0;--j)
{
if(a[j] > b[i])
++c[i];
else
break;
}
}
for(int i = 0;i < m; ++i)
{
if(c[i] == 0)
++ans;
}
printf("Case #%d:\n",number);
if(ans == 0)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
for(int i = 0;i < m;++i)
{
printf("%d ", c[i]);
}
printf("\n");
}
return 0;
}