#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  while (cin >> n >> k) {
    long long int odd = (n + 1) >> 1;
    if (k > odd) {
      k -= odd;
      cout << (k << 1) << "\n";
    } else
      cout << (k << 1) - 1 << "\n";
  }
}
