#include <bits/stdc++.h>
using namespace std;
ifstream fin("f.in");
int n;
char g[5][5];
bool _check(char g[5][5], int i, int j, int dir, int cnt) {
  if (cnt == 3) return true;
  if (i < 0 || j >= 4) return false;
  switch (dir) {
    case 1:
      return g[i][j] == 'x' && _check(g, i - 1, j, dir, cnt + 1);
    case 2:
      return g[i][j] == 'x' && _check(g, i + 1, j, dir, cnt + 1);
    case 3:
      return g[i][j] == 'x' && _check(g, i, j - 1, dir, cnt + 1);
    case 4:
      return g[i][j] == 'x' && _check(g, i, j + 1, dir, cnt + 1);
    case 5:
      return g[i][j] == 'x' && _check(g, i - 1, j - 1, dir, cnt + 1);
    case 6:
      return g[i][j] == 'x' && _check(g, i - 1, j + 1, dir, cnt + 1);
    case 7:
      return g[i][j] == 'x' && _check(g, i + 1, j - 1, dir, cnt + 1);
    case 8:
      return g[i][j] == 'x' && _check(g, i + 1, j + 1, dir, cnt + 1);
  }
}
bool check(char g[5][5]) {
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (g[i][j] == 'x') {
        if (_check(g, i - 1, j, 1, 1) || _check(g, i + 1, j, 2, 1) ||
            _check(g, i, j - 1, 3, 1) || _check(g, i, j + 1, 4, 1) ||
            _check(g, i - 1, j - 1, 5, 1) || _check(g, i - 1, j + 1, 6, 1) ||
            _check(g, i + 1, j - 1, 7, 1) || _check(g, i + 1, j + 1, 8, 1))
          return true;
      }
    }
  }
  return false;
}
void solve() {
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      cin >> g[i][j];
    }
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (g[i][j] == '.') {
        g[i][j] = 'x';
        if (check(g)) {
          cout << "YES" << endl;
          return;
        }
        g[i][j] = '.';
      }
    }
  }
  cout << "NO" << endl;
}
int main() {
  solve();
  return 0;
}
