#include <bits/stdc++.h>
using namespace std;
const int size = 1e6 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  char arr[4][n];
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < n; j++) arr[i][j] = '.';
  if (k % 2 == 0)
    for (int i = 1; i <= k / 2; i++) arr[1][i] = '#', arr[2][i] = '#';
  else {
    arr[1][(int)n / 2] = '#';
    k--;
    int l = 1;
    int r = n - 2;
    int i = 0;
    while (l <= r && i < n - 3 && k > 0) {
      if (i % 2 == 0)
        arr[1][l++] = '#';
      else
        arr[1][r--] = '#';
      i++;
      k--;
    }
    l = 1;
    r = n - 2;
    i = 0;
    while (l <= r && k > 0) {
      if (i % 2 == 0)
        arr[2][l++] = '#';
      else
        arr[2][r--] = '#';
      i++;
      k--;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) cout << arr[i][j];
    cout << endl;
  }
}
