#include <iostream> #define LL long long using namespace std; int main(){ LL n,k; cin >> n >>k; LL split = n%2 ? n/2+1 : n/2; if( k <= split ) cout<<-1+2*k<<endl; else cout<<2*(k-split)<<endl; return 0; }