#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int tmp;
  while (b) {
    a %= b;
    tmp = a;
    a = b;
    b = tmp;
  }
  return a;
}
int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string b[] = {"monday", "tuesday",  "wednesday", "thursday",
              "friday", "saturday", "sunday"};
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int p1, p2;
  for (int i = 0; i < 7; i++)
    if (s1 == b[i]) p1 = i;
  for (int i = 0; i < 7; i++)
    if (s2 == b[i]) p2 = i;
  bool ok = false;
  for (int i = 0; i < 11; i++) {
    int m = (p1 + a[i]) % 7;
    if (m == p2) ok = true;
  }
  printf("%s\n", ok ? "YES" : "NO");
}
