#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <typename... Args>
void writeln(Args... args) {
  ((cout << args << " "), ...);
  cout << endl;
}
template <typename... Args>
void _db(Args... args) {}
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<char> v1(n, '.');
  vector<char> v2(n, '.');
  if (k % 2 == 0) {
    for (int i = 1; i <= k / 2; ++i) {
      v1[i] = '#';
      v2[i] = '#';
    }
  } else {
    if (k > n - 2) {
      for (int i = 1; i < n - 1; ++i) {
        v1[i] = '#';
      }
      int left = k - (n - 2);
      _db("left", left);
      int mid = n / 2;
      _db("mid is", mid);
      int inc = left / 2;
      _db("inc is", inc);
      for (int i = 0; i < inc; ++i) {
        _db("set left", mid - 1 - inc);
        _db("set right", mid + 1 + inc);
        v2[mid - 1 - i] = '#';
        v2[mid + 1 + i] = '#';
      }
    } else {
      for (int i = (n / 2) - (k / 2); i <= (n / 2) + (k / 2); ++i) {
        v1[i] = '#';
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    cout << '.';
  }
  cout << endl;
  for (char c : v1) {
    cout << c;
  }
  cout << endl;
  for (char c : v2) {
    cout << c;
  }
  cout << endl;
  for (int i = 0; i < n; ++i) {
    cout << '.';
  }
  cout << endl;
  return 0;
}
