#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s[2];
  long long int n, k, i;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    s[0] += ".";
    s[1] += ".";
  }
  if (k % 2 == 0) {
    for (i = 1; i <= k / 2; i++) s[0][i] = s[1][i] = '#';
  } else {
    if (k <= n - 2) {
      k--;
      s[0][n / 2] = '#';
      for (i = 1; i <= k / 2; i++) s[0][n / 2 - i] = s[0][n / 2 + i] = '#';
    } else {
      for (i = 1; i <= n - 2; i++) s[0][i] = '#';
      k -= n - 2;
      for (i = 1; i <= k / 2; i++) s[1][i] = s[1][n - 1 - i] = '#';
    }
  }
  cout << "YES\n";
  for (i = 0; i < n; i++) cout << ".";
  cout << "\n";
  cout << s[0] << "\n";
  cout << s[1] << "\n";
  for (i = 0; i < n; i++) cout << ".";
  cout << "\n";
  return 0;
}
