#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  string mat[4];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) {
      mat[i].push_back('.');
    }
  }
  string temp = ".";
  for (int i = 1; i < n - 1; i++) temp.push_back('#');
  temp.push_back('.');
  if (k & 1) {
    if (k == 1) {
      cout << "YES\n";
      mat[1][n / 2] = '#';
      for (int i = 0; i < 4; i++) {
        cout << mat[i] << "\n";
      }
      return 0;
    } else {
      cout << "YES\n";
      mat[1][n / 2] = '#';
      k--;
      for (int i = 1; i < n - 1 and k and (i < n - i - 1); i++) {
        mat[1][i] = '#';
        mat[1][n - i - 1] = '#';
        k -= 2;
      }
      for (int i = 1; i < n - 1 and k; i++) {
        mat[2][i] = '#';
        mat[2][n - i - 1] = '#';
        k -= 2;
      }
      for (int i = 0; i < 4; i++) {
        cout << mat[i] << "\n";
      }
    }
  } else {
    for (int i = 1; i < n - 1 and k; i++) {
      mat[1][i] = '#';
      mat[2][i] = '#';
      k -= 2;
    }
    cout << "YES\n";
    for (int i = 0; i < 4; i++) {
      cout << mat[i] << "\n";
    }
  }
}
