#include <bits/stdc++.h>
using namespace std;
const int Nmax = 100, inf = 1e9 + 7, base = 1e9;
long long phi(long long a) {
  long long ans = a;
  for (long long i = 2; i * i <= a; ++i) {
    if (a % i == 0) ans -= ans / i;
    while (a % i == 0) a /= i;
  }
  if (a > 1) ans -= ans / a;
  return ans;
}
bool arr[4][Nmax];
int main() {
  int n, k;
  cin >> n >> k;
  if (k == 1 && !(n & 1)) {
    cout << "NO\n";
    return 0;
  }
  int u = 0;
  n -= 2;
  while (k > 1) {
    if (u < n / 2)
      arr[1][u] = arr[1][n - u - 1] = 1;
    else if (u < 2 * (n / 2))
      arr[2][u - n / 2] = arr[2][n - u - 1 + n / 2] = 1;
    else
      arr[1][n / 2] = arr[2][n / 2] = 1;
    k -= 2;
    u++;
  }
  if (k) arr[1][n / 2] = 1;
  cout << "YES\n";
  for (int i = 0; i < 4; ++i) {
    cout << '.';
    for (int j = 0; j < n; ++j)
      if (!arr[i][j])
        cout << '.';
      else
        cout << '#';
    cout << '.';
    cout << '\n';
  }
  return 0;
}
