#include <bits/stdc++.h>
using namespace std;
string a, b;
int x, y;
int main() {
  cin >> a >> b;
  if (a == "monday")
    x = 0;
  else if (a == "tuesday")
    x = 1;
  else if (a == "wednesday")
    x = 2;
  else if (a == "thursday")
    x = 3;
  else if (a == "friday")
    x = 4;
  else if (a == "saturday")
    x = 5;
  else if (a == "sunday")
    x = 6;
  if (b == "monday")
    y = 0;
  else if (b == "tuesday")
    y = 1;
  else if (b == "wednesday")
    y = 2;
  else if (b == "thursday")
    y = 3;
  else if (b == "friday")
    y = 4;
  else if (b == "saturday")
    y = 5;
  else if (b == "sunday")
    y = 6;
  if (x == y)
    cout << "YES";
  else if (y == (x + 2) % 7 || y == (x + 3) % 7)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
