#include <bits/stdc++.h>
using namespace std;
int numarr[400];
int main() {
  int n, k;
  cin >> n >> k;
  if (k > 2 * n - 4) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    if (k % 2 == 0) {
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < n; j++) {
          if (i == 0 || i == 3) {
            cout << ".";
          } else if (j != 0 && j <= k / 2) {
            cout << "#";
          } else {
            cout << ".";
          }
        }
        cout << endl;
      }
    } else {
      int cnt = k;
      memset(numarr, 0, sizeof(int) * n * 4);
      numarr[n * 1 + n / 2] = 1;
      cnt--;
      for (int i = 1; i <= 2; i++) {
        for (int j = n / 2 - 1; j > 0; j--) {
          if (cnt <= 0) {
            break;
          }
          numarr[i * n + j] = 1;
          numarr[i * n + (n / 2 + (n / 2 - j))] = 1;
          cnt -= 2;
        }
      }
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < n; j++) {
          if (numarr[i * n + j] == 0) {
            cout << ".";
          } else {
            cout << "#";
          }
        }
        cout << endl;
      }
    }
  }
  return 0;
}
