It is short for Yankee.
The origin of Yankee has been the subject of much debate, but the most likely
source is the Dutch name Janke, meaning 'little Jan' or 'little John,' a nickname
that dates back to the 1680s. Perhaps because it was used as the name of pirates,
the name Yankee came to be used as a term of contempt. It was used this way in
the 1750s by General James Wolfe, the British general who secured British domination
of North America by defeating the French at Quebec. The name may have been applied
to New Englanders as an extension of an original use referring to Dutch settlers
living along the Hudson River. Whatever the reason, Yankee is first recorded in
1765 as a name for an inhabitant of New England. The first recorded use of the term
by the British to refer to Americans in general appears in the 1780s, in a letter by
Lord Horatio Nelson, no less. Around the same time it began to be abbreviated to
Yank. During the American Revolution, American soldiers adopted this term of derision
as a term of national pride. The derisive use nonetheless remained alive and even
intensified in the South during the Civil War, when it referred not to all Americans
but to those loyal to the Union.
http://dictionary.reference.com/search?q=yankee