#include <bits/stdc++.h>
using namespace std;
vector<string> s(4);
int n, k;
void outp() {
  cout << "YES";
  for (int i = 0; i < 4; i++) {
    cout << "\n";
    for (int j = 0; j < n; j++) cout << s[i][j];
  }
  exit(0);
}
void t1() {
  for (int i = 1; i <= k / 2; i++) {
    s[1][i] = '#';
    s[2][i] = '#';
  }
  outp();
}
void t2() {
  for (int i = 1; i < n - 1; i++) s[1][i] = '#';
  s[2][n - 2] = '#';
  for (int i = 1; i <= k - n + 1; i++) s[2][i] = '#';
  outp();
}
void t3() {
  int i, j, kk;
  i = n / 2;
  j = i;
  kk = k + 1;
  while (kk > 0) {
    s[1][i] = '#';
    s[1][j] = '#';
    i++;
    j--;
    kk -= 2;
  }
  outp();
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < n; j++) s[i] += '.';
  if (k <= 2 * n - 4) {
    if (k % 2 == 0) t1();
    if (k >= n) t2();
    if (k % 2 == 1 && k <= n - 2) t3();
  }
  cout << "NO";
}
