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