#include <iostream> using namespace std; int main() { unsigned long long a, b; cin >> a >> b; if (b > a / 2 + a % 2){ b -= a / 2 + a % 2; cout << b*2; } else cout << b*2-1; return 0; }