#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long mid = n - n / 2;
  if (k <= mid)
    cout << 2 * k - 1 << "\n";
  else
    cout << 2 * (k - mid) << "\n";
  return 0;
}
