#include <bits/stdc++.h>
using namespace std;
int n, k, i, j;
char c[4][200];
int main() {
  cin >> n >> k;
  for (i = 0; i < 4; i++)
    for (j = 0; j < n; j++) c[i][j] = '.';
  for (j = 1; j < 3; j++)
    for (i = 1; i < n / 2 && k > 1; i++, k -= 2)
      c[j][i] = c[j][n - 1 - i] = '#';
  if (k > 0) c[1][n / 2] = '#';
  if (k > 1) c[2][n / 2] = '#';
  cout << "YES" << endl;
  for (i = 0; i < 4; i++, cout << endl)
    for (j = 0; j < n; j++) cout << c[i][j];
}
