#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  char a[4][n];
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < n; ++j) {
      a[i][j] = '.';
    }
  }
  if (k <= 2 * (n - 2)) {
    if (!(k % 2)) {
      int j = 1;
      while (k) {
        a[1][j] = '#';
        a[2][j] = '#';
        j++;
        k -= 2;
      }
    } else {
      int i = 1;
      while (k > 0) {
        for (int l = 1; l < n - 1; l++) {
          a[i][l] = '#';
        }
        k = k - n + 2;
        i++;
      }
      i--;
      if (k != 0) {
        int j = 0;
        int mid = n / 2;
        if (i == 2) {
          k++;
          a[i][mid] = '.';
          while (k) {
            a[i][1 + j] = '.';
            a[i][n - 2 - j] = '.';
            k += 2;
            j++;
          }
        } else {
          while (k) {
            a[i][1 + j] = '.';
            a[i][n - 2 - j] = '.';
            k += 2;
            j++;
          }
        }
      }
    }
    cout << "YES" << endl;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < n; j++) {
        cout << a[i][j];
      }
      cout << endl;
    }
  } else {
    cout << "NO" << endl;
  }
}
