Freiman's 18th-inning single lifts A's over Yanks