#include <bits/stdc++.h>
using namespace std;
void pr1l(int n) {
  while (n--) cout << ".";
  cout << endl;
}
void pr1lh(int n, int k) {
  cout << ".";
  n--;
  while (n--) {
    if (k > 0) {
      cout << "#";
      k--;
    } else
      cout << ".";
  }
  cout << endl;
}
int main() {
  int n, k;
  cin >> n >> k;
  if (k % 2 == 0) {
    if (k / 2 <= n - 2) {
      cout << "YES" << endl;
      pr1l(n);
      int ctr = 0;
      for (int i = 0; i < n; i++) {
        if (i >= 1 && ctr < k / 2) {
          cout << "#";
          ctr++;
        } else
          cout << ".";
      }
      cout << endl;
      ctr = 0;
      for (int i = 0; i < n; i++) {
        if (i >= 1 && ctr < k / 2) {
          cout << "#";
          ctr++;
        } else
          cout << ".";
      }
      cout << endl;
      pr1l(n);
    } else
      cout << "NO" << endl;
  } else if (k <= n - 2) {
    cout << "YES" << endl;
    int offset = (n - k) / 2;
    pr1l(n);
    int ctr = 0;
    for (int i = 0; i < n; i++) {
      if (i >= offset && ctr < k) {
        cout << "#";
        ctr++;
      } else
        cout << ".";
    }
    cout << endl;
    pr1l(n);
    pr1l(n);
  } else if (k > n - 2 && k <= 2 * n - 4) {
    cout << "YES" << endl;
    pr1l(n);
    int ctr = 0;
    for (int i = 0; i < n; i++) {
      if (i > 0 && ctr < k / 2 + 1) {
        ctr++;
        if (ctr == k / 2) {
          cout << ".";
          continue;
        } else
          cout << "#";
      } else
        cout << ".";
    }
    cout << endl;
    pr1lh(n, k / 2 + 1);
    pr1l(n);
  } else
    cout << "NO" << endl;
  return 0;
}
