#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
template <class T = long long>
T IN() {
  T x;
  cin >> x;
  return (x);
}
template <class Head>
void VT(Head head) {}
template <class Head, class Seco, class... Tail>
void VT(Head&& head, Seco&& seco, Tail&&... tail) {
  seco.resize(head);
  VT(head, move(tail)...);
}
void VT2() {}
template <class Head, class... Tail>
void VT2(Head&& head, Tail&&... tail) {
  for (auto& youso_ : (head)) cin >> youso_;
  VT2(move(tail)...);
}
template <class Head>
void VT3(Head&& head) {}
template <class Head, class Seco, class... Tail>
void VT3(Head&& head, Seco&& seco, Tail&&... tail) {
  seco[head] = IN();
  VT3(head, move(tail)...);
}
int main() {
  int n, k;
  CINT(n, k);
  if ((n - 2) * 2 < k)
    if (1) {
      cout << "NO" << endl;
      return 0;
    };
  cout << ((1) ? "YES" : "NO") << endl;
  vector<vector<long long> > v(4, vector<long long>(n, 0));
  auto f = [&] {
    if (k % 2 == 0) {
      for (int i = 0; i < (k / 2); ++i) {
        v[1][i + 1] = 1;
        v[2][i + 1] = 1;
      }
    } else {
      v[1][n / 2] = 1;
      --k;
      int kk = k;
      for (int i = (1); i < (k / 2 + 1); ++i) {
        if (n / 2 - i == 0) break;
        v[1][n / 2 + i] = 1;
        v[1][n / 2 - i] = 1;
        kk -= 2;
      }
      for (int i = (1); i < (kk / 2 + 1); ++i) {
        v[2][n / 2 + i] = 1;
        v[2][n / 2 - i] = 1;
      }
    }
  };
  f();
  for (int i = 0; i < (4); ++i) {
    for (int j = 0; j < (n); ++j) {
      if (v[i][j])
        cout << "#";
      else
        cout << ".";
    }
    cout << endl;
  }
  return 0;
}
