#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, p;
  cin >> n >> k;
  cout << "YES\n";
  if (k % 2 == 1) {
    if (k >= n - 2) {
      for (int i = 1; i <= n; i++) {
        cout << ".";
      }
      cout << "\n";
      cout << ".";
      for (int i = 2; i <= n - 1; i++) {
        cout << "#";
      }
      cout << ".\n";
      cout << ".";
      if (k != n - 2) cout << "#";
      for (int i = 1; i <= n - (k - n + 2) - 2; i++) {
        cout << ".";
      }
      for (int i = 1; i <= k - n + 1; i++) {
        cout << "#";
      }
      cout << ".\n";
      for (int i = 1; i <= n; i++) {
        cout << ".";
      }
    } else {
      p = k / 2;
      for (int i = 1; i <= n; i++) {
        cout << ".";
      }
      cout << "\n";
      for (int i = 1; i <= n / 2 - p; i++) {
        cout << ".";
      }
      for (int i = 1; i <= k; i++) {
        cout << "#";
      }
      for (int i = 1; i <= n / 2 - p; i++) {
        cout << ".";
      }
      cout << "\n";
      for (int i = 1; i <= n; i++) {
        cout << ".";
      }
      cout << "\n";
      for (int i = 1; i <= n; i++) {
        cout << ".";
      }
    }
  } else {
    for (int i = 1; i <= n; i++) {
      cout << ".";
    }
    cout << "\n";
    p = k / 2;
    cout << ".";
    for (int i = 1; i <= p; i++) {
      cout << "#";
    }
    for (int i = 1; i <= n - p - 1; i++) {
      cout << ".";
    }
    cout << "\n";
    cout << ".";
    for (int i = 1; i <= p; i++) {
      cout << "#";
    }
    for (int i = 1; i <= n - p - 1; i++) {
      cout << ".";
    }
    cout << "\n";
    for (int i = 1; i <= n; i++) {
      cout << ".";
    }
  }
  return 0;
}
