import std.stdio;
import std.range;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.container;
import std.typecons;
import std.random;
import std.csv;
import std.regex;
import std.math;
import core.time;
import std.ascii;
import std.digest.sha;
import std.outbuffer;
import std.numeric;

void main()
{
	int n, k;
	readln.chomp.split.tie(n, k);
	if (2 * (n - 2) < k) {
		"NO".writeln;
		return;
	}
	"YES".writeln;
	char[][] ans = new char[][](4, n);
	foreach (i; 0..4) {
		foreach (j; 0..n) {
			ans[i][j] = '.';
		}
	}
	// vertical
	for (int i = 1; i <= 2; ++i) {
		if (k < n - 2) {
			break;
		}
		for (int j = 1; j < n - 1; ++j) {
			ans[i][j] = '#';
		}
		k -= n - 2;
	}
	immutable MID = n / 2;
	if (k % 2 == 1) {
		ans[2][MID] = '#';
		--k;
	}
	for (int i = 1; k > 0; ++i) {
		ans[2][MID - i] = ans[2][MID + i] = '#';
		k -= 2;
	}
	foreach (s; ans) {
		foreach (c; s) {
			c.write;
		}
		writeln;
	}
}

void tie(R, Args...)(R arr, ref Args args)
		if (isRandomAccessRange!R || isArray!R)
in
{
	assert (arr.length == args.length);
}
body
{
	foreach (i, ref v; args) {
		alias T = typeof(v);
		v = arr[i].to!T;
	}
}

void verbose(Args...)(in Args args)
{
	stderr.write("[");
	foreach (i, ref v; args) {
		if (i) stderr.write(", ");
		stderr.write(v);
	}
	stderr.writeln("]");
}

