#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
//#define int long long
#define ll long long
#define P pair<int,int>
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define all(V) V.begin(),V.end()
#ifdef int
constexpr int INF = LLONG_MAX / 10;
#else
constexpr int INF = INT_MAX / 10;
#endif
constexpr double eps = 1e-9;
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
using namespace std;
inline ll gcd(ll a, ll b) {
	while (b) {
		ll c = a;
		a = b; b = c % b;
	}
	return a;
}
inline ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
bool isprime(ll n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
ll mypow(ll a, ll b) {
	if (!b)return 1;
	if (b & 1)return mypow(a, b - 1) * a;
	ll memo = mypow(a, b >> 1);
	return memo * memo;
}
template<typename T, typename U>
class SegTree {
protected:
	int n = 1, rank = 0;
	vector<T> node;
	vector<U> lazy;
	vector<bool> lazyflag;
	vector<int> width;
	T nodee;
	virtual T nodef(const T&, const T&)const = 0;
	virtual void lazyf(U&, const U&) = 0;
	virtual void updf(T&, const U&, const unsigned int&) = 0;
	void eval(int k) {
		if (!k)return;
		for (int i = rank; i > 0; i--) {
			int nk = k >> i;
			if (lazyflag[nk]) {
				updf(node[2 * nk], lazy[nk], width[2 * nk]);
				updf(node[2 * nk + 1], lazy[nk], width[2 * nk + 1]);
				if (lazyflag[2 * nk])lazyf(lazy[2 * nk], lazy[nk]);
				else lazy[2 * nk] = lazy[nk];
				if (lazyflag[2 * nk + 1])lazyf(lazy[2 * nk + 1], lazy[nk]);
				else lazy[2 * nk + 1] = lazy[nk];
				lazyflag[2 * nk] = lazyflag[2 * nk + 1] = true;
				lazyflag[nk] = false;
			}
		}
	}
public:
	SegTree(unsigned int m, T init, T nodee) :nodee(nodee) {
		while (n < m) {
			n *= 2;
			rank++;
		}
		node.resize(2 * n); lazy.resize(2 * n); lazyflag.resize(2 * n, false); width.resize(2 * n);
		for (int i = n; i < 2 * n; i++)node[i] = init;
		width[1] = n;
		for (int i = 2; i < 2 * n; i++) {
			width[i] = width[i >> 1] >> 1;
		}
	}
	SegTree(T nodee, const vector<T>& initvec) :nodee(nodee) {
		unsigned int m = initvec.size();
		while (n < m) {
			n *= 2;
			rank++;
		}
		node.resize(2 * n); lazy.resize(2 * n); lazyflag.resize(2 * n, false); width.resize(2 * n);
		for (int i = n; i < 2 * n; i++) {
			if (i - n < m)node[i] = initvec[i - n];
			else node[i] = nodee;
		}
		width[1] = n;
		for (int i = 2; i < 2 * n; i++) {
			width[i] = width[i >> 1] >> 1;
		}
	}
	void update(int i, U x) {
		i += n;
		eval(i);
		updf(node[i], x, width[i]);
		if (lazyflag[i])lazyf(lazy[i], x);
		else {
			lazyflag[i] = true;
			lazy[i] = x;
		}
		while (i /= 2)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	void update(int l, int r, U x) {
		l += n; r += n;
		int nl = l, nr = r;
		while (!(nl & 1))nl >>= 1;
		while (!(nr & 1))nr >>= 1;
		nr--;
		eval(nl); eval(nr);
		while (l < r) {
			if (l & 1) {
				updf(node[l], x, width[l]);
				if (lazyflag[l])lazyf(lazy[l], x);
				else {
					lazyflag[l] = true;
					lazy[l] = x;
				}
				l++;
			}
			if (r & 1) {
				r--;
				updf(node[r], x, width[r]);
				if (lazyflag[r])lazyf(lazy[r], x);
				else {
					lazyflag[r] = true;
					lazy[r] = x;
				}
			}
			l >>= 1; r >>= 1;
		}
		while (nl >>= 1)node[nl] = nodef(node[2 * nl], node[2 * nl + 1]);
		while (nr >>= 1)node[nr] = nodef(node[2 * nr], node[2 * nr + 1]);
	}
	T query(int l, int r) {
		l += n; r += n;
		eval(l); eval(r - 1);
		int ls = nodee, rs = nodee;
		while (l < r) {
			if (l & 1) {
				ls = nodef(ls, node[l]);
				l++;
			}
			if (r & 1) {
				r--;
				rs = nodef(node[r], rs);
			}
			l >>= 1; r >>= 1;
		}
		return nodef(ls, rs);
	}
	T queryForAll() {
		return node[1];
	}
	void fill(T value) {
		for (int i = n; i < 2 * n; i++)node[i] = value;
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
		std::fill(all(lazyflag), false);
	}
};
class RAQRSQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return a + b; }
	void lazyf(int& a, const int& b) { a += b; }
	void updf(int& a, const int& b, const unsigned int& width) { a += width * b; }
public:
	RAQRSQ(int size, const int& def = 0) :SegTree<int, int>(size, def, 0) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RAQRSQ(const vector<int>& initvec) :SegTree<int, int>(0, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class RAQRMiQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return min(a, b); }
	void lazyf(int& a, const int& b) { a += b; }
	void updf(int& a, const int& b, const unsigned int& width) { a += b; }
public:
	RAQRMiQ(int size, const int& def = 0) :SegTree<int, int>(size, def, INF) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RAQRMiQ(const vector<int>& initvec) :SegTree<int, int>(INF, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class RAQRMaQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return max(a, b); }
	void lazyf(int& a, const int& b) { a += b; }
	void updf(int& a, const int& b, const unsigned int& width) { a += b; }
public:
	RAQRMaQ(unsigned int size, const int& def = 0) :SegTree<int, int>(size, def, -INF) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RAQRMaQ(const vector<int>& initvec) :SegTree<int, int>(-INF, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class RUQRSQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return a + b; }
	void lazyf(int& a, const int& b) { a = b; }
	void updf(int& a, const int& b, const unsigned int& width) { a = width * b; }
public:
	RUQRSQ(int size, const int& def = 0) :SegTree<int, int>(size, def, 0) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RUQRSQ(const vector<int>& initvec) :SegTree<int, int>(0, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class RUQRMiQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return min(a, b); }
	void lazyf(int& a, const int& b) { a = b; }
	void updf(int& a, const int& b, const unsigned int& width) { a = b; }
public:
	RUQRMiQ(int size, const int& def = 0) :SegTree<int, int>(size, def, INF) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RUQRMiQ(const vector<int>& initvec) :SegTree<int, int>(INF, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class RUQRMaQ :public SegTree<int, int> {
	int nodef(const int& a, const int& b)const { return max(a, b); }
	void lazyf(int& a, const int& b) { a = b; }
	void updf(int& a, const int& b, const unsigned int& width) { a = b; }
public:
	RUQRMaQ(int size, const int& def = 0) :SegTree<int, int>(size, def, -INF) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
	RUQRMaQ(const vector<int>& initvec) :SegTree<int, int>(-INF, initvec) {
		for (int i = n - 1; i > 0; i--)node[i] = nodef(node[2 * i], node[2 * i + 1]);
	}
};
class Compression {
	vector<int> vec;
public:
	Compression(const vector<int>& v) :vec(v) {
		sort(all(vec));
		vec.erase(unique(all(vec)), vec.end());
	}
	template<typename I>
	Compression(I first, I last) {
		for (auto ite = first; ite != last; ite++) {
			vec.emplace_back(*ite);
		}
		sort(all(vec));
		vec.erase(unique(all(vec)), vec.end());
	}
	vector<int> data() {
		return vec;
	}
	int operator[](const int& value) {
		if (binary_search(all(vec), value))return std::lower_bound(all(vec), value) - vec.begin();
		else {
			cerr << "The demanded element does not exist." << endl;
			exit(1);
		}
	}
	vector<int>::iterator upper_bound(int value) {
		return std::upper_bound(all(vec), value);
	}
	vector<int>::iterator lower_bound(int value) {
		return std::lower_bound(all(vec), value);
	}
	vector<int>::iterator begin() {
		return vec.begin();
	}
	vector<int>::iterator end() {
		return vec.end();
	}
	unsigned int size() {
		return vec.size();
	}
};
int n, x[4010], y[4010], l[4010], comped[4010][2];
signed main() {
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5])puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256