#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  string str1;
  int n;
  int m;
  while (cin >> str) {
    cin >> str1;
    if (str == "monday")
      n = 1;
    else if (str == "tuesday")
      n = 2;
    else if (str == "wednesday")
      n = 3;
    else if (str == "thursday")
      n = 4;
    else if (str == "friday")
      n = 5;
    else if (str == "saturday")
      n = 6;
    else if (str == "sunday")
      n = 7;
    if (str1 == "monday")
      m = 1;
    else if (str1 == "tuesday")
      m = 2;
    else if (str1 == "wednesday")
      m = 3;
    else if (str1 == "thursday")
      m = 4;
    else if (str1 == "friday")
      m = 5;
    else if (str1 == "saturday")
      m = 6;
    else if (str1 == "sunday")
      m = 7;
    int num = (m - n + 7) % 7;
    if (num == 0 || num == 2 || num == 3)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
