#include <bits/stdc++.h>
using namespace std;
long long int ma = -1, mi = 1000000000000000;
inline long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
inline long long int lcm(long long int a, long long int b, long long int MOD) {
  return a / gcd(a, b) * b % MOD;
}
long long int power(long long int x, unsigned int y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, a[100009] = {0}, b[100009] = {0}, c = 0, d = 0;
  string n, m;
  cin >> n >> m;
  if (n == "monday") {
    if (m == "monday" || m == "wednesday" || m == "thursday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "tuesday") {
    if (m == "tuesday" || m == "friday" || m == "thursday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "wednesday") {
    if (m == "friday" || m == "wednesday" || m == "saturday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "thursday") {
    if (m == "saturday" || m == "sunday" || m == "thursday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "friday") {
    if (m == "friday" || m == "sunday" || m == "monday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "saturday") {
    if (m == "saturday" || m == "monday" || m == "tuesday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (n == "sunday") {
    if (m == "sunday" || m == "wednesday" || m == "tuesday") {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
