#include <bits/stdc++.h>
long long int mod = 1000000007;
using namespace std;
void solve() {
  long long int n, k;
  cin >> n >> k;
  char ans[4][n];
  int nval = n - 2;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) {
      ans[i][j] = '.';
    }
  }
  int mid = nval / 2;
  mid++;
  if (k % 2 == 1) {
    for (int i = 1; i < 3; i++) {
      if (k <= 0) break;
      for (int j = mid; j >= 1; j--) {
        if (i > 1 && k % 2 == 0 && k < nval) {
          ans[i][1] = '#';
          ans[i][n - 2] = '#';
          k--;
          k--;
        }
        if (k > 0) {
          ans[i][j] = '#';
          k--;
          if (k <= 0) break;
          ans[i][mid + (mid - j)] = '#';
          if (j != mid) k--;
        } else
          break;
      }
    }
  } else {
    for (int i = 1; i < n - 1; i++) {
      for (int j = 1; j < 3; j++) {
        if (k) {
          ans[j][i] = '#';
          k--;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) {
      cout << ans[i][j];
    }
    cout << endl;
  }
}
int main() {
  solve();
  return 0;
}
