Magnetic impurities in s-wave superconductors lead to spin-polarized Yu-Shiba-Rusinov (YSR) in-gap states. Chains of magnetic impurities offer one of the most viable routes for the realization of Majorana bound states which hold a promise for topological quantum computing. However, this ambitious goal looks distant since no quantum coherent degrees of freedom have yet been identified in these systems. To fill this gap we propose an effective two-level system, a YSR qubit, stemming from two nearby impurities. Using a time-dependent wave-function approach, we derive an effective Hamiltonian describing the YSR qubit evolution as a function of distance between the impurity spins, their relative orientations, and their dynamics. We show that the YSR qubit can be controlled and read out using state-of-the-art experimental techniques for manipulation of the spins. Finally, we address the effect of spin noise on the coherence properties of the YSR qubit, and show a robust behaviour for a wide range of experimentally relevant parameters. Looking forward, the YSR qubit could facilitate the implementation of a universal set of quantum gates in hybrid systems where they are coupled to topological Majorana qubits.