#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  char a[5][n + 1];
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= n; j++) {
      a[i][j] = '.';
    }
  }
  if (n == 3 && k == 2) {
    cout << "YES\n";
    cout << "...\n.#.\n.#.\n...";
    return 0;
  }
  long long t = k;
  if (k % 2 == 1) {
    a[2][(n / 2) + 1] = '#';
    k--;
  }
  long long st = 2, en = n - 1;
  while (k > 0 && st <= en) {
    if (st != en)
      k -= 2;
    else {
      if (t % 2 == 0) {
        break;
      }
      if (a[2][st] != '#') {
        k--;
      }
    }
    a[2][st] = '#';
    a[2][en] = '#';
    st++;
    en--;
  }
  st = 2, en = n - 1;
  while (k > 0 && st <= en) {
    if (st != en)
      k -= 2;
    else {
      if (a[3][st] != '#') {
        k--;
      }
    }
    a[3][st] = '#';
    a[3][en] = '#';
    st++;
    en--;
  }
  if (k > 0) {
    if (a[3][(n / 2) + 1] != '#') k--;
    a[3][(n / 2) + 1] = '#';
  }
  if (k > 0) {
    a[2][(n / 2) + 1] = '#';
    k--;
  }
  cout << "YES\n";
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j];
    }
    cout << "\n";
  }
  return 0;
}
