#include <bits/stdc++.h>
using namespace std;
int n, k, t;
int adadsasd[101];
int main() {
  cin >> n >> k;
  if (k % 2 == 0) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << '.';
    cout << endl;
    cout << '.';
    t = k / 2 + k % 2;
    k -= t;
    for (int i = 2; i < n; i++) {
      if (t > 0) {
        cout << '#';
        t--;
      } else
        cout << '.';
    }
    cout << '.' << endl << '.';
    for (int i = 2; i < n; i++)
      if (k > 0) {
        cout << '#';
        k--;
      } else
        cout << '.';
    cout << '.' << endl;
    for (int i = 1; i <= n; i++) cout << '.';
    return 0;
  }
  if (k > n - 2) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << '.';
    cout << endl;
    cout << '.';
    for (int i = 1; i <= n - 2; i++) cout << '#';
    cout << '.' << endl;
    k -= (n - 2);
    k /= 2;
    cout << '.';
    for (int i = 1; i <= k; i++) cout << '#';
    for (int i = 1; i <= n - 2 - 2 * k; i++) cout << '.';
    for (int i = 1; i <= k; i++) cout << '#';
    cout << '.';
    cout << endl;
    for (int i = 1; i <= n; i++) cout << '.';
    return 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << '.';
  cout << endl;
  int a = (n - k) / 2;
  for (int i = 1; i <= a; i++) cout << '.';
  for (int i = 1; i <= k; i++) cout << '#';
  for (int i = 1; i <= a; i++) cout << '.';
  cout << endl;
  for (int i = 1; i <= n; i++) cout << '.';
  cout << endl;
  for (int i = 1; i <= n; i++) cout << '.';
  return 0;
}
