#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7ffffff;
const int MAXN = +3;
int n, k;
int main() {
  cin >> n >> k;
  if (!(k % 2)) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << ".";
    cout << endl;
    cout << ".";
    for (int i = 0; i < k / 2; i++) cout << "#";
    for (int i = 0; i < n - 1 - k / 2; i++) cout << ".";
    cout << endl;
    cout << ".";
    for (int i = 0; i < k / 2; i++) cout << "#";
    for (int i = 0; i < n - 1 - k / 2; i++) cout << ".";
    cout << endl;
    for (int i = 0; i < n; i++) cout << ".";
  } else {
    if (n > 3 && k == (n - 2) * 2 - 1) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << ".";
      cout << endl << ".";
      for (int i = 0; i < n - 2; i++) cout << "#";
      cout << "." << endl << ".";
      for (int i = 0; i < n / 2 - 1; i++) cout << "#";
      cout << ".";
      for (int i = 0; i < n / 2 - 1; i++) cout << "#";
      cout << "." << endl;
      for (int i = 0; i < n; i++) cout << ".";
    } else if (k == 1) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << ".";
      cout << endl;
      for (int i = 0; i < n / 2; i++) cout << ".";
      cout << "#";
      for (int i = 0; i < n / 2; i++) cout << ".";
      cout << endl;
      for (int i = 0; i < n; i++) cout << ".";
      cout << endl;
      for (int i = 0; i < n; i++) cout << ".";
    } else {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) cout << ".";
      cout << endl;
      for (int i = 0; i < n - (k - 3) / 2 - 4; i++) cout << '.';
      for (int i = 0; i < (k - 3) / 2; i++) cout << '#';
      cout << "#.#.\n";
      for (int i = 0; i < n - (k - 3) / 2 - 4; i++) cout << '.';
      for (int i = 0; i < (k - 3) / 2; i++) cout << '#';
      cout << "#...\n";
      for (int i = 0; i < n; i++) cout << ".";
    }
  }
  return 0;
}
