#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    cout << "YES" << endl;
    char arr[2][n];
    for (long long i = 0; i < 2; i++)
      for (long long j = 0; j < n; j++) arr[i][j] = '.';
    long long it1 = 1, it2 = 1, rw = 0;
    if (k % 2 == 0) {
      while (k) arr[1][it1] = '#', arr[0][it1++] = '#', k -= 2;
    } else if (k % 2) {
      arr[rw][n / 2] = '#';
      k--;
      while (k) {
        if (it2 == n / 2) rw++, it2 = 1;
        arr[rw][it2] = '#', arr[rw][n - (++it2)] = '#', k -= 2;
      }
    }
    for (long long i = 0; i < n; i++) cout << ".";
    cout << endl;
    for (long long i = 0; i < n; i++) cout << arr[0][i];
    cout << endl;
    for (long long i = 0; i < n; i++) cout << arr[1][i];
    cout << endl;
    for (long long i = 0; i < n; i++) cout << ".";
    cout << endl;
  }
  return 0;
}
