#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    cout << "YES" << endl;
    if (k % 2 == 0) {
      int cnt = k / 2;
      for (int i = 1; i <= 4; i++) {
        for (int j = 1; j <= n; j++) {
          if (i == 1 || i == 4) {
            cout << ".";
          } else {
            if (j == 1 || j == n) {
              cout << ".";
            } else {
              if (j <= cnt + 1) {
                cout << "#";
              } else {
                cout << ".";
              }
            }
          }
        }
        cout << endl;
      }
    } else {
      if (k <= (n - 2)) {
        int cnt = (n - k) / 2;
        for (int i = 1; i <= 4; i++) {
          for (int j = 1; j <= n; j++) {
            if (i == 1 || i == 3 || i == 4) {
              cout << ".";
            } else {
              if (j == 1 || j == n)
                cout << ".";
              else {
                if (j > cnt && j < (cnt + k + 1))
                  cout << "#";
                else
                  cout << ".";
              }
            }
          }
          cout << endl;
        }
      } else {
        char a[5][105];
        for (int i = 1; i <= 4; i++) {
          for (int j = 1; j <= n; j++) a[i][j] = '.';
        }
        a[2][2] = a[3][2] = a[3][3] = '#';
        int cnt = k / 2 - 1;
        for (int i = 4; i < 4 + cnt; i++) a[2][i] = a[3][i] = '#';
        for (int i = 1; i <= 4; i++) {
          for (int j = 1; j <= n; j++) {
            cout << a[i][j];
          }
          cout << endl;
        }
      }
    }
  }
  return 0;
}
