As a general rule, following these recommendations is the safest way to go if you're hoping for the best chances of admission. However, you won't be rejected for deviating from them slightly if you have good reason to do so. Note that the Harvard's admissions website also says, "Most of all we look for students who make the most of their opportunities and the resources available to them, and who are likely to continue to do so throughout their lives." Making the most of your learning opportunities in high school might mean deciding to take a slightly different path than the one dictated by the course recommendations.
For example, you might be a student who excels in debate and is passionate about politics and history. If you chose to take an additional history class your senior year instead of a foreign language class, colleges would consider this to be a logical choice and would not penalize you for it even if they officially recommend four years of a foreign language. Think about it this way: can you justify taking the electives you want to take instead of science classes based on your other academic or extracurricular passions? If you're really, really into another academic or extracurricular pursuit that will feature prominently in your application, then you could make the choice to forgo a core class to advance your skills in that area.
That being said, science is a subject area that is particularly important to most schools. I would still recommend taking at least three years of science in high school in preparation for a competitive college program. Harvard does require you to take science classes as a part of its general education curriculum. You'll have an easier time with those classes if you've already been subjected to a thorough scientific education in high school. You should also check the graduation requirements at your high school to see how many courses in each subject area you need to take.
If you haven't already read our in-depth article on how to get into selective colleges like Harvard, I'd recommend that you look through it. The key is making logical choices with your courses so you can paint a clear picture of your interests while maintaining a strong core academic foundation.