#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  string g[4] = {string(n, '.'), string(n, '.'), string(n, '.'),
                 string(n, '.')};
  int h = 0;
  if (k % 2 == 0) {
    cout << "YES" << endl;
    int j = 1;
    for (h = 0; h < k; h += 2, ++j) {
      g[1][j] = '#';
      g[2][j] = '#';
    }
  } else {
    cout << "YES" << endl;
    int j = 1;
    g[1][n / 2] = '#';
    ++h;
    for (; h < k && h < n - 2; h += 2, ++j) {
      g[1][n / 2 - j] = '#';
      g[1][n / 2 + j] = '#';
    }
    j = 1;
    for (; h < k; h += 2, ++j) {
      g[2][n / 2 - j] = '#';
      g[2][n / 2 + j] = '#';
    }
  }
  for (int i = 0; i < 4; ++i) {
    cout << g[i] << endl;
  }
  return 0;
}
