#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,k;
cin>>n>>k;
//cout<<n/2<<"\n";
if(k<=n/2 && n%2==0){
cout<<1+(k-1)*2<<"\n";
}
else if(k<=n/2+1 && n%2==1){
cout<<1+(k-1)*2<<"\n";
}
else{
long long t;
if(n%2==0){
t = k - n/2;
}
else t = k - n/2 - 1;
cout<<2 +(t-1)*2<<"\n";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CgogICAgbG9uZyBsb25nIG4sazsKCiAgICBjaW4+Pm4+Pms7CgogICAgLy9jb3V0PDxuLzI8PCJcbiI7CiAgICBpZihrPD1uLzIgJiYgbiUyPT0wKXsKICAgICAgICBjb3V0PDwxKyhrLTEpKjI8PCJcbiI7CiAgICB9CiAgICBlbHNlIGlmKGs8PW4vMisxICYmIG4lMj09MSl7CiAgICAgICAgY291dDw8MSsoay0xKSoyPDwiXG4iOwogICAgfQogICAgZWxzZXsKICAgICAgICBsb25nIGxvbmcgdDsKICAgICAgICBpZihuJTI9PTApewogICAgICAgICAgICB0ID0gayAtIG4vMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB0ID0gayAtIG4vMiAtIDE7CiAgICAgICAgY291dDw8MiArKHQtMSkqMjw8IlxuIjsKICAgIH0KCgoKfQoKCg==