#include <bits/stdc++.h>
using namespace std;
map<string, int> CharMap;
void num2str() {
  CharMap["sunday"] = 0;
  CharMap["monday"] = 1;
  CharMap["tuesday"] = 2;
  CharMap["wednesday"] = 3;
  CharMap["thursday"] = 4;
  CharMap["friday"] = 5;
  CharMap["saturday"] = 6;
}
long long pow1(long long x, long long y) {
  if (y == 0) return 1;
  long long temp = pow1(x, y / 2) % 1000000007;
  if (y % 2 == 0)
    return (temp * temp) % 1000000007;
  else
    return (((temp * temp) % 1000000007) * x) % 1000000007;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  num2str();
  string s1, s2;
  cin >> s1 >> s2;
  int a = CharMap[s1];
  int b = CharMap[s2];
  if ((a + 3) % 7 == b || a == b || (a + 2) % 7 == b)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
