#include <bits/stdc++.h>
using namespace std;
char grid[4][4];
bool winner(char c) {
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      int ver = 0, hor = 0, crs1 = 0, crs2 = 0;
      for (int k = 0; k < 3; ++k) {
        if (i + k < 4) ver += grid[i + k][j] == c;
        if (j + k < 4) hor += grid[i][j + k] == c;
        if (i + k < 4 && j + k < 4) crs1 += grid[i + k][j + k] == c;
        if (i + k < 4 && j - k >= 0) crs2 += grid[i + k][j - k] == c;
      }
      if (ver == 3 || hor == 3 || crs1 == 3 || crs2 == 3) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int os = 0, xs = 0;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      cin >> grid[i][j];
      os += grid[i][j] == 'o';
      xs += grid[i][j] == 'x';
    }
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (grid[i][j] == '.') {
        grid[i][j] = (os == xs) ? 'x' : 'o';
        if (winner(grid[i][j])) {
          cout << "YES\n";
          return 0;
        }
        grid[i][j] = '.';
      }
    }
  }
  cout << "NO\n";
  return 0;
}
