#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << ".";
  cout << endl;
  if (!(k & 1)) {
    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 < k / 2; ++i) cout << "#";
    for (int i = 0; i < n - 1 - (k / 2); ++i) cout << ".";
  } else if (k <= n - 2) {
    for (int i = 1; i < (n + 1) / 2 - (k / 2); ++i) cout << ".";
    for (int i = 0; i < k; ++i) cout << "#";
    for (int i = 0; i <= n - k - ((n + 1) / 2 - (k / 2)); ++i) cout << ".";
    cout << endl;
    for (int i = 0; i < n; ++i) cout << ".";
  } else {
    cout << ".";
    for (int i = 0; i < n - 2; ++i) cout << "#";
    cout << "." << endl << ".";
    for (int i = 0; i < (k - n + 2) / 2; ++i) cout << "#";
    for (int i = 0; i < 2 * n - k - 4; ++i) cout << ".";
    for (int i = 0; i < (k - n + 2) / 2; ++i) cout << "#";
    cout << ".";
  }
  cout << endl;
  for (int i = 0; i < n; ++i) cout << ".";
  return 0;
}
