Yes singh this is right. During sunset and sunrise the path of light is longer and the scattering is more that scatters the larger wavelength resulting in red and yellow color.
Rayleigh scattering depends on wavelength to the 4th power. This means the blue rays in the solar spectrum are much more scattered than the red light. During the day one looks at light directly scattered by the air molecules at a large angle from the sun.
At sunrise and sundown the light of the sun goes through a very long layer of air molecules. These preferentially scatter blue light away from the direction of the solar beam so that in the solar beam itself the red is preferentially retained. This also means that the "sky" near to the sun is red.
During the day the sun goes through a much steeper angle thru the atmosphere and thus encounters much less molecules. Its appearance is white. However the sky is blue because this the light that is scattered by the air molecules toward our eyes. As mentioned molecules preferential scatter blue light and hence the "sky" is seen as blue.
There are exceptions when there is "dust particles" in the air. Such particles also scatter light. The size of the particles determine the wavelength-dependence of the scattering. This complicates the picture at places where natural and/or manmade particles dominate the light-scattering.