Place the beef in a skillet over medium heat, and cook until evenly brown. Drain grease.
In a large pot, mix the beans, corn, tomato sauce, tomato paste, and water. Bring to a boil, and reduce heat to low. In a food processor, finely chop the jalapenos, habanero, onion, and garlic. Mix into the pot. Mix in the cooked beef. Stir in masa flour. Season with cayenne pepper, chili powder, salt, black pepper, and sugar. Cook 45 minutes to 1 hour, stirring occasionally.