NEW HAVEN, Conn. (AP) _ President John F. Kennedy, Harvard class of 1940, couldn't resist some good-natured teasing when Yale awarded him an honorary doctorate in 1962.

''As General de Gaulle occasionally acknowledged America to be the daughter of Europe, so I am pleased to come to Yale, the daughter of Harvard,'' Kennedy told graduates assembled in the courtyard of Yale's Old Campus on that sunny June day.

''It might be said now that I have the best of both worlds - a Harvard education and a Yale degree,'' Kennedy said.

This year's presidential campaign has elevated what is perhaps the oldest, most intense and most snobbish rivalry in America to a new height.

For the spoils of this contest will go either to a Yale man or a Harvard man - only the second time in 200 years that graduates of the two schools have vied for the presidency of the United States.

And the only other time it happened, in 1912, the Harvard man, Theodore Roosevelt, and the Yale man, William Howard Taft, both lost to a Princeton man, Woodrow Wilson.

While Kennedy was a master at exploiting his Harvard education for political advantage, Republican George Bush, Yale class of 1948, has tried to turn Democrat Michael S. Dukakis' Harvard connections into a campaign liability.

Bush, scion of a wealthy Greenwich, Conn., family, accuses the Massachusetts governor, the son of Greek immigrants, of having a ''Harvard boutique'' mentality tainted by ''liberalism and elitism.''

Campaigning Saturday in Modesto, Calif., Bush said, ''I don't want somebody from Harvard telling me what I can do and what I can't do.''

Asked about that statement at a news conference Sunday, Bush said he did not want to take on the institution itself, asking ''How can I, a nice guy from Yale, feel that way about Harvard? Now come on.

''I'm talking about a handful of people that have served in (recent) Democratic administrations that come out of the same liberal philisophy. And they know who they are,'' he said. ''There's an elite inside the elite there.''

Dukakis, in turn, has tried to stay out of the Harvard-Yale debate, saying his 1960 Harvard law degree and teaching stint at Harvard's Kennedy School of Government don't make him a Harvard man at all.

''I'm a Swarthmore guy,'' Dukakis says, referring to the liberal arts college in Pennsylvania where he received his undergraduate degree.

But Bush's Harvard line held little sting given his own Ivy League connections. And it probably was lost on most Americans, who view both Yale and Harvard as elite Eastern universities for the wealthy.

Dukakis campaign aides couldn't hold their tongues when outgoing Education Secretary William Bennett, himself a Harvard Law School graduate, asserted on national television in September that the Harvard crowd ''with which Mike Dukakis runs ... think they're smarter'' than most Americans.

''Bill Bennett spent seven or eight years getting an education in Massachussetts and these comments are a clear indication that it didn't do him a bit of good,'' shot back Mark Gearan, press secretary at Dukakis' Boston headquarters.

Harvard and Yale have eyed each other with haughty disdain for nearly 300 years, since Yale was founded in 1701 by a group of clergy worried about religious backsliding at the more liberal Harvard, the oldest college in America. Harvard was founded in 1636, just 16 years after the Pilgrims landed at Plymouth Rock.

''We have been natural rivals almost from the beginning,'' George Pierson, the Larned professor emeritus of history at Yale, said recently. ''We were the only two with the exception of William and Mary that you could go to. After that, we both grew in the favor of the Lord.''

The Harvard-Yale annual crew race is the oldest intercollegiate sports rivalry in America, dating from 1852. The schools refer to their annual football contest as ''The Game,'' as if all others hardly matter.

Other Harvard-Yale presidential campaigns have been averted only by quirks of history. The 1824 election would have pitted Harvard graduate John Quincy Adams against Yale graduate John Calhoun, but Calhoun dropped out and threw his support to Adams, who defeated Andrew Jackson, who didn't have a college degree.

The 1876 contest between Rutherford B. Hayes, a graduate of Harvard Law School, against Samuel Tilden would have been a Harvard-Yale matchup, except Tilden dropped out of Yale after one year and graduated from New York University.

Although this is only the second head-to-head match, Harvard and Yale both boast presidents among their graduates. While Yale holds the edge in their football series, 56-40, and Harvard holds the edge in crew races, 72-51, Harvard holds a substantial lead in the presidential sweepstakes: six Harvard graduates have held the office - John Adams, John Quincy Adams, Hayes, Theodore Roosevelt, Franklin Roosevelt and Kennedy - compared to just two from Yale - Taft and Gerald Ford, a 1941 graduate of Yale Law School.

Raymond Wolfinger, a political scientist at the University of California at Berkeley, says most Americans don't give a hoot about the Harvard-Yale rivalry.

''In terms of the mass public, the difference between Harvard and Yale is nonsense,'' said Wolfinger, who earned his doctorate at Yale.