#include <bits/stdc++.h>
using namespace std;
const int N = int(300000) + 5;
template <typename T, typename T1>
void prin(vector<pair<T, T1> >& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].fi << " " << a[i].se << "\n";
  }
}
template <typename T>
void prin_new_line(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << "\n";
  }
}
template <typename T, typename T1>
void prin_new_line(vector<pair<T, T1> >& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i].fi << " " << a[i].se << "\n";
  }
}
int sum_vec(vector<int>& a) {
  int s = 0;
  for (int i = 0; i < a.size(); i++) {
    s += a[i];
  }
  return s;
}
template <typename T>
T max(vector<T>& a) {
  T ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = max(ans, a[i]);
  }
  return ans;
}
template <typename T>
T min(vector<T>& a) {
  T ans = a[0];
  for (int i = 1; i < a.size(); i++) {
    ans = min(ans, a[i]);
  }
  return ans;
}
template <typename T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <typename T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
long double s_triangle(long double x1, long double y1, long double x2,
                       long double y2, long double x3, long double y3) {
  return abs(((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)) / 2);
}
bool overflow(long long int a, long long int b) {
  if (a * b / b != a) return true;
  return false;
}
long long int n, m, q, x1, y3, x2, y2, x, u, d, l, ri, y, cnt;
int day(string s) {
  if (s == "monday") return 1;
  if (s == "tuesday") return 2;
  if (s == "wednesday") return 3;
  if (s == "thursday") return 4;
  if (s == "friday") return 5;
  if (s == "saturday") return 6;
  if (s == "sunday") return 7;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s, p;
  cin >> s >> p;
  long long int dis = day(p) - day(s);
  dis = (dis + 7) % 7;
  if (dis == 0 or dis == 2 or dis == 3)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
