#include <bits/stdc++.h>
const int inf_int = 2e9;
const long long inf_ll = 2e18;
const int maxn = 5e2 + 10;
using namespace std;
inline int read() {
  int ra, fh;
  char rx;
  rx = getchar(), ra = 0, fh = 1;
  while ((rx < '0' || rx > '9') && rx != '-') rx = getchar();
  if (rx == '-') fh = -1, rx = getchar();
  while (rx >= '0' && rx <= '9') ra *= 10, ra += rx - 48, rx = getchar();
  return ra * fh;
}
long long gcd(long long p, long long q) { return q == 0 ? p : gcd(q, p % q); }
long long qpow(long long p, long long q) {
  long long f = 1;
  while (q) {
    if (q & 1) f = f * p;
    p = p * p;
    q >>= 1;
  }
  return f;
}
int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
map<string, int> p;
int main() {
  char st1[100];
  char st2[100];
  p["monday"] = 1;
  p["tuesday"] = 2;
  p["wednesday"] = 3;
  p["thursday"] = 4;
  p["friday"] = 5;
  p["saturday"] = 6;
  p["sunday"] = 7;
  scanf("%s", st1);
  scanf("%s", st2);
  int t1 = p[st1];
  int t2 = p[st2];
  if (t2 < t1) t2 += 7;
  int re = t2 - t1;
  if (re == 0 || re == 2 || re == 3)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
