#include <bits/stdc++.h>
using namespace std;
map<string, int> q;
string a, b;
int res, aa, bb;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  q["monday"] = 0;
  q["tuesday"] = 1;
  q["wednesday"] = 2;
  q["thursday"] = 3;
  q["friday"] = 4;
  q["saturday"] = 5;
  q["sunday"] = 6;
  cin >> a >> b;
  aa = q[a];
  bb = q[b];
  res = bb - aa;
  res += 7;
  res %= 7;
  if (res == 1 || res > 3) {
    cout << "NO";
  } else {
    cout << "YES";
  }
  return 0;
}
