#include <bits/stdc++.h>
using namespace std;
char a[5][(100 + 10)] = {0};
int main() {
  int n, y;
  cin >> n >> y;
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= n; j++) a[i][j] = '.';
  if (y % 2 == 0) {
    int p = y / 2;
    for (int i = (n - p) / 2 + 1; i <= (n - p) / 2 + p; i++)
      a[2][i] = a[3][i] = '#';
  } else {
    if (y <= n - 2) {
      int p = y;
      for (int i = (n - p) / 2 + 1; i <= (n - p) / 2 + p; i++) a[2][i] = '#';
    } else {
      for (int i = 2; i <= n - 1; i++) a[2][i] = '#';
      int p = (y - n + 2) / 2;
      for (int i = 1; i <= p; i++) a[3][1 + i] = a[3][n - i] = '#';
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= 4; i++) cout << a[i] + 1 << endl;
  return 0;
}
