#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  k <= (long long)ceil(n / 2.0) ? cout << 2 * k - 1
                                : cout << 2 * (k - (long long)ceil(n / 2.0));
  return 0;
}
