#include <bits/stdc++.h>
using namespace std;
char grid[5][5];
bool inline inside(int i, int j) { return i >= 0 && i < 4 && j >= 0 && j < 4; }
int main() {
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) cin >> grid[i][j];
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (grid[i][j] == '.' || grid[i][j] == 'x') {
        if (inside(i + 1, j) && inside(i + 2, j) && grid[i + 1][j] == 'x' &&
            grid[i + 2][j] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i - 1, j) && inside(i - 2, j) && grid[i - 1][j] == 'x' &&
            grid[i - 2][j] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i, j + 1) && inside(i, j + 2) && grid[i][j + 1] == 'x' &&
            grid[i][j + 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i, j - 1) && inside(i, j - 2) && grid[i][j - 1] == 'x' &&
            grid[i][j - 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i + 1, j + 1) && inside(i + 2, j + 2) &&
            grid[i + 1][j + 1] == 'x' && grid[i + 2][j + 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i - 1, j - 1) && inside(i - 2, j - 2) &&
            grid[i - 1][j - 1] == 'x' && grid[i - 2][j - 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i - 1, j + 1) && inside(i - 2, j + 2) &&
            grid[i - 1][j + 1] == 'x' && grid[i - 2][j + 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i + 1, j - 1) && inside(i + 2, j - 2) &&
            grid[i + 1][j - 1] == 'x' && grid[i + 2][j - 2] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i + 1, j) && inside(i - 1, j) && grid[i + 1][j] == 'x' &&
            grid[i - 1][j] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i, j + 1) && inside(i, j - 1) && grid[i][j + 1] == 'x' &&
            grid[i][j - 1] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i + 1, j + 1) && inside(i - 1, j - 1) &&
            grid[i + 1][j + 1] == 'x' && grid[i - 1][j - 1] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
        if (inside(i - 1, j + 1) && inside(i + 1, j - 1) &&
            grid[i - 1][j + 1] == 'x' && grid[i + 1][j - 1] == 'x') {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  cout << "NO" << endl;
  return 0;
}
