There is no requirement to be flexible in order to begin a yoga practice. This is a common misperception. Many people come to yoga in the hopes of increasing their flexibility and improving their posture, often thinking they will arrive at these results purely by stretching the areas that are tight.
Instead, yoga helps to build stability in the muscles, and thereby the joints, helping to prevent the compensatory actions in the body that lead to poor movement patterns that result in poor posture. As strength and stability increases it translates into an increase in your range of motion in the muscles and the joints. This allows for a more structurally sound body position (posture) and makes it easier to stay in good body alignment.
Yes, and a lack of flexibility is actually a great reason to start practicing yoga. The good news is that a regular yoga practice will enhance flexibility. Yoga poses work on both increasing the elasticity of connective tissues as well as the stretch reflex and other functions of the involuntary nervous system. Individual yoga postures and flexibility tend to evolve over time with a continued practice due to focusing on full breath, specifically exhalation which furthers relaxing and releasing into various deep stretches. This continuous stretching causes a gradual opening of the body, lengthening of the muscles, and lubrication of the joints allowing you to find more mobility in movement and deepening your stretching ability. Just as lifting weights builds muscle over time, a consistent yoga practice increases overall flexibility.