abc188_a - Three Point Shot

\[|x - y| < 3\]

Time complexity: $O(1)$

Memory complexity: $O(1)$

Click to show code.


using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
int main(void)
{
    ios::sync_with_stdio(false), cin.tie(NULL);
    int x, y;
    cin >> x >> y;
    string ans[2] = {"No", "Yes"};
    cout << (abs(x - y) < 3 ? "Yes" : "No") << endl;
    return 0;
}